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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/bitodeme/resources/base.rb +11 -4
- data/lib/bitodeme/resources/transaction_log.rb +3 -3
- data/lib/bitodeme/resources/withdrawal.rb +2 -2
- data/lib/bitodeme/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 56f8b05227cbcca27dbc5b5f88b18d15f459117d
|
4
|
+
data.tar.gz: 68e21e9f601253633b4938a817cba8638d0d8832
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f3bd0e6c051c23fec544d8f7abd59be35b316885f5eb62aa16b4adabff7ae0ae89aa767e3c54d299a44330f38a60cfa8269f09a757bdcc1fa5d72766849a14ce
|
7
|
+
data.tar.gz: 68c96129bd31d8c95c74f7f7e1a044f9397f51acf0b4b82a507a9fa13e430be8401a88a2f00a2c42bbdc27b0e8fb8709612098f69b02cf154c0cee94775e1372
|
data/Gemfile.lock
CHANGED
@@ -20,8 +20,8 @@ module Bitodeme
|
|
20
20
|
new(item)
|
21
21
|
end
|
22
22
|
|
23
|
-
def _all(collection,
|
24
|
-
items = get("/api/v1/#{collection}", _query_params(
|
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(
|
34
|
-
|
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(
|
60
|
+
post('/api/v1/withdrawals', data).body
|
61
61
|
end
|
62
62
|
|
63
63
|
private
|
data/lib/bitodeme/version.rb
CHANGED