bitodeme 0.2.6 → 0.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f07072e5db12b27ce22231b25d44347150067f27
4
- data.tar.gz: e4996136754a5ba5a55ba30af975b239c0e875d4
3
+ metadata.gz: 56f8b05227cbcca27dbc5b5f88b18d15f459117d
4
+ data.tar.gz: 68e21e9f601253633b4938a817cba8638d0d8832
5
5
  SHA512:
6
- metadata.gz: 4357d3a7e15161f2a0c847f3b2ecba063c998aefd6ac2a5077aee3afedb61719ed7faa5c4ae8f726129d3aa91ebb93403e1aa2fa83dadd4f9359405e2b200649
7
- data.tar.gz: 14850f2d43d8eaadf97b381275c38f5ebc35532873215bef5ce443831ac6cd05cd914dc5580cccab951bda2be9fa44c21fd4c8a5b316fe8f31d5ea174faf2384
6
+ metadata.gz: f3bd0e6c051c23fec544d8f7abd59be35b316885f5eb62aa16b4adabff7ae0ae89aa767e3c54d299a44330f38a60cfa8269f09a757bdcc1fa5d72766849a14ce
7
+ data.tar.gz: 68c96129bd31d8c95c74f7f7e1a044f9397f51acf0b4b82a507a9fa13e430be8401a88a2f00a2c42bbdc27b0e8fb8709612098f69b02cf154c0cee94775e1372
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bitodeme (0.2.5)
4
+ bitodeme (0.2.6)
5
5
  dotenv (~> 2.2, >= 2.2)
6
6
  faraday (~> 0.13)
7
7
  faraday_middleware (~> 0.12)
@@ -20,8 +20,8 @@ module Bitodeme
20
20
  new(item)
21
21
  end
22
22
 
23
- def _all(collection, options)
24
- items = get("/api/v1/#{collection}", _query_params(options)).body
23
+ def _all(collection, opts)
24
+ items = get("/api/v1/#{collection}", _query_params(opts)).body
25
25
  items.fetch(collection, []).map { |item| new(item) }
26
26
  end
27
27
 
@@ -30,8 +30,15 @@ module Bitodeme
30
30
  new(item)
31
31
  end
32
32
 
33
- def _query_params(page: 1, per_page: 50, since: 0)
34
- { page: page, per_page: per_page, since: since }
33
+ def _query_params(opts)
34
+ query_params = {
35
+ page: opts.fetch(:page, 1),
36
+ per_page: opts.fetch(:per_page, 50),
37
+ since: opts.fetch(:since, 0)
38
+ }
39
+ query_params[:starts_at] = opts[:starts_at] if opts.key?(:starts_at)
40
+ query_params[:ends_at] = opts[:ends_at] if opts.key?(:ends_at)
41
+ query_params
35
42
  end
36
43
  end
37
44
 
@@ -28,15 +28,15 @@ module Bitodeme
28
28
  # Unique identifier
29
29
  attr_reader :id
30
30
 
31
+ # Transaction detail
32
+ attr_reader :transactable
33
+
31
34
  # Polymorphic relation identifier for transaction
32
35
  attr_reader :transactable_id
33
36
 
34
37
  # Polymorphic relation type for transaction
35
38
  attr_reader :transactable_type
36
39
 
37
- # Transaction detail
38
- attr_reader :transactable
39
-
40
40
  # Updated at in milliseconds
41
41
  attr_reader :updated_at
42
42
 
@@ -55,9 +55,9 @@ module Bitodeme
55
55
  # Arguments:
56
56
  # withdrawal: (Bitodeme::Resource::Withdrawal)
57
57
  def create(withdrawal)
58
- raise_for('withdrawal') unless withdrawal.is_a?(Withdrawal)
58
+ raise_for('withdrawal', withdrawal) unless withdrawal.is_a?(Withdrawal)
59
59
  data = { withdrawal: withdrawal.to_h }
60
- post("/api/v1/withdrawals", data).body
60
+ post('/api/v1/withdrawals', data).body
61
61
  end
62
62
 
63
63
  private
@@ -1,3 +1,3 @@
1
1
  module Bitodeme
2
- VERSION = '0.2.6'.freeze
2
+ VERSION = '0.2.7'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bitodeme
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bitodeme Integrations Team