bitodeme 0.1.2 → 0.1.3
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/auth.rb +0 -1
- data/lib/bitodeme/conn.rb +0 -1
- data/lib/bitodeme/resources/invoice.rb +7 -7
- data/lib/bitodeme/resources/withdrawal.rb +7 -7
- 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: 7528d5ae4f9c08fd57d550625e40238c201aa588
|
4
|
+
data.tar.gz: 7aa39ae83bf7ca8639dce202d60d38a3375280c2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 79034c5ac6a4e72fbefa922c2fb6aac6702989dfa1f92ae6ddc259e5f8526cc54907fd03665cac7b86f534c76e00a2ffebc86a389b2f8c3cf81bd79c59abe2bd
|
7
|
+
data.tar.gz: c593ce516ed5eb6663dee9d6639e3f1cb104754fe9951e3b4569e0012b8096a08216a1d7b85fdbfa91d554a254f29039fae853a885f81dc9525c32b42cacc3d2
|
data/Gemfile.lock
CHANGED
data/lib/bitodeme/auth.rb
CHANGED
data/lib/bitodeme/conn.rb
CHANGED
@@ -27,7 +27,6 @@ module Bitodeme
|
|
27
27
|
Faraday.new(faraday_opts) do |faraday|
|
28
28
|
faraday.request :oauth2, auth.token, token_type: :bearer
|
29
29
|
faraday.request :json
|
30
|
-
faraday.response :logger
|
31
30
|
faraday.response :json, content_type: /\bjson$/
|
32
31
|
faraday.adapter Faraday.default_adapter
|
33
32
|
end
|
@@ -69,7 +69,7 @@ module Bitodeme
|
|
69
69
|
# Arguments:
|
70
70
|
# params: (Hash)
|
71
71
|
def build(params)
|
72
|
-
new(params).validate
|
72
|
+
new(params).send(:validate)
|
73
73
|
end
|
74
74
|
|
75
75
|
# Find an invoice
|
@@ -111,6 +111,12 @@ module Bitodeme
|
|
111
111
|
end
|
112
112
|
end
|
113
113
|
|
114
|
+
private
|
115
|
+
|
116
|
+
def initialize(params)
|
117
|
+
super(attrs: attrs, params: params)
|
118
|
+
end
|
119
|
+
|
114
120
|
def validate
|
115
121
|
validate_original_amount
|
116
122
|
validate_original_currency_code
|
@@ -119,8 +125,6 @@ module Bitodeme
|
|
119
125
|
self
|
120
126
|
end
|
121
127
|
|
122
|
-
private
|
123
|
-
|
124
128
|
def validate_original_amount
|
125
129
|
return if /^\d{0,8}(\.\d{1,8})?$/.match?(original_amount.to_s)
|
126
130
|
raise_for('original_amount')
|
@@ -138,10 +142,6 @@ module Bitodeme
|
|
138
142
|
def validate_purchasable
|
139
143
|
raise_for('purchasable') unless purchasable.is_a?(Hash)
|
140
144
|
end
|
141
|
-
|
142
|
-
def initialize(params)
|
143
|
-
super(attrs: attrs, params: params)
|
144
|
-
end
|
145
145
|
end
|
146
146
|
end
|
147
147
|
end
|
@@ -35,7 +35,7 @@ module Bitodeme
|
|
35
35
|
# Arguments:
|
36
36
|
# params: (Hash)
|
37
37
|
def build(params)
|
38
|
-
new(params).validate
|
38
|
+
new(params).send(:validate)
|
39
39
|
end
|
40
40
|
|
41
41
|
# Craete a new withdrawal(send money)
|
@@ -67,6 +67,12 @@ module Bitodeme
|
|
67
67
|
end
|
68
68
|
end
|
69
69
|
|
70
|
+
private
|
71
|
+
|
72
|
+
def initialize(params)
|
73
|
+
super(attrs: attrs, params: params)
|
74
|
+
end
|
75
|
+
|
70
76
|
def validate
|
71
77
|
validate_address
|
72
78
|
validate_amount
|
@@ -75,12 +81,6 @@ module Bitodeme
|
|
75
81
|
self
|
76
82
|
end
|
77
83
|
|
78
|
-
private
|
79
|
-
|
80
|
-
def initialize(params)
|
81
|
-
super(attrs: attrs, params: params)
|
82
|
-
end
|
83
|
-
|
84
84
|
def validate_address
|
85
85
|
raise_for('address') unless address.is_a?(String)
|
86
86
|
end
|
data/lib/bitodeme/version.rb
CHANGED