synapse_pay_rest 3.4.2 → 3.4.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5c739268324bccef13ac3b3cfdcf97c6de821b0acfd30ec0ab8df1a7b7d4466a
4
- data.tar.gz: 8b19a633a2da3cf57040b3d765a5b71e12231b30fa008b44eef0a94ec649b801
3
+ metadata.gz: 66269b68182386602d6a40b1991b74e86c3d8c597e9eff157e1989c7a7518700
4
+ data.tar.gz: b3e42f519a6cd3c6211072b5666a2f27f9d7c85d467b0f1d28f05a08cc86b365
5
5
  SHA512:
6
- metadata.gz: e3f12fd2df17e7b2f6b0c2f805497dd30ce031299af3eadc1ed38ee8ef0fd1819791d5c1d2673200cfd5adc9e50ee271339978f1c7d704f3160e99a7e0a16f4e
7
- data.tar.gz: 243fa3411c03815f237cf606d4882ac34bf993897d5ce71815873b85af43fa8c842eb392a5c0661b4e30683b87afd76f7c067d86239284209715d3e4093f9ac6
6
+ metadata.gz: e54165d81946de7acc22e9967cd9aedb5512b15b6287598079616f41ede11d8d97eec3cd6ed11df3cd9042144181cbdf14ca98cdc0d0d69feabccfbed710248f
7
+ data.tar.gz: 0cc5e1e53aaa3f1c25f79355db21c79694844502fa0d678a2944f7fa736ca379635e3def34c15c5a44d17b469c923e18a1ed4674844e4df386a84f471e815fb8
@@ -384,6 +384,16 @@ module SynapsePayRest
384
384
  Subnet.find(node: self, id: id)
385
385
  end
386
386
 
387
+ # Get statement for node
388
+ # Only available for native synapse nodes
389
+ #
390
+ # @raise [SynapsePayRest::Error]
391
+ #
392
+ # @return [SynapsePayRest::Statement]
393
+ def get_statement()
394
+ Statement.by_node(client: self.user.client, node: self)
395
+ end
396
+
387
397
  # Deactivates the node.
388
398
  #
389
399
  # @raise [SynapsePayRest::Error]
@@ -4,7 +4,7 @@ module SynapsePayRest
4
4
  # is intended to make it easier to use the API without knowing payload formats
5
5
  # or knowledge of REST.
6
6
  class Statement
7
- attr_reader :client, :id, :date_end, :date_start, :csv_url, :pdf_url, :user, :node
7
+ attr_reader :client, :id, :date_end, :date_start, :csv_url, :pdf_url, :json_url, :user, :node
8
8
 
9
9
  class << self
10
10
  # Creates a statements instance from a response hash.
@@ -16,7 +16,8 @@ module SynapsePayRest
16
16
  date_end: response['date_end'],
17
17
  date_start: response['date_start'],
18
18
  csv_url: response['urls']['csv'],
19
- pdf_url: response['urls']['pdf']
19
+ pdf_url: response['urls']['pdf'],
20
+ json_url: response['urls']['json']
20
21
  }
21
22
  self.new(args)
22
23
  end
@@ -776,6 +776,18 @@ module SynapsePayRest
776
776
  CryptoUsNode.create(user: self, **options)
777
777
  end
778
778
 
779
+
780
+ # Gets statement for user
781
+ #
782
+ #
783
+ # @raise [SynapsePayRest::Error]
784
+ #
785
+ # @return [SynapsePayRest::Statement]
786
+
787
+ def get_statement()
788
+ Statement.by_user(client: self.client, user:self)
789
+ end
790
+
779
791
  # Checks if two User instances have same id (different instances of same record).
780
792
  def ==(other)
781
793
  other.instance_of?(self.class) && !id.nil? && id == other.id
@@ -1,4 +1,4 @@
1
1
  module SynapsePayRest
2
2
  # Gem version
3
- VERSION = '3.4.2'.freeze
3
+ VERSION = '3.4.3'.freeze
4
4
  end
data/samples.md CHANGED
@@ -1432,4 +1432,21 @@ node = user.find_node(id: '5b634a241jngjnei04c7b39b1')
1432
1432
 
1433
1433
  statements = SynapsePayRest::Statement.by_node(client: client, node: node)
1434
1434
  # => [#<SynapsePayRest::Statement>, #<SynapsePayRest::Statement>, ...]
1435
+ ```
1436
+ ##### c) User#get_statement
1437
+
1438
+ ```ruby
1439
+ user = SynapsePayRest::User.find(client: client, id: '5b5f95dc83403300fbc76')
1440
+
1441
+ statements = user.get_statement()
1442
+ # => [#<SynapsePayRest::Statement>, #<SynapsePayRest::Statement>, ...]
1443
+ ```
1444
+ ##### d) Node#get_statement
1445
+
1446
+ ```ruby
1447
+ user = SynapsePayRest::User.find(client: client, id: '5b5f95dc83403300fbc76')
1448
+ node = user.find_node(id: '5b634a241jngjnei04c7b39b1')
1449
+
1450
+ statements = node.get_statement()
1451
+ # => [#<SynapsePayRest::Statement>, #<SynapsePayRest::Statement>, ...]
1435
1452
  ```
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: synapse_pay_rest
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.4.2
4
+ version: 3.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steven Broderick
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2018-09-11 00:00:00.000000000 Z
12
+ date: 2018-09-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rest-client