flowcommerce-reference 0.4.0 → 0.4.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/lib/flow-reference.rb +3 -3
- data/lib/flow_reference_v0_client.rb +39 -39
- data/lib/generated/continents.rb +4 -4
- data/lib/generated/countries.rb +3 -3
- data/lib/generated/currencies.rb +2 -2
- data/lib/generated/languages.rb +2 -2
- data/lib/generated/payment_methods.rb +2 -2
- data/lib/io_flow_reference_v0.rb +28 -28
- data/lib/version.rb +4 -2
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 30bd29625543ff5bac7a45f82270d4247068d193
|
4
|
+
data.tar.gz: 58e797a4114de98b84b43796658dd88c12115997
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6d306d35323c5c387c2a7fa5c735af975f42523d9fbcbaa83d40e6d96eb39e59f5d202333283ee334062b2b448a743b32094bbcf4a8ef898a570ea16d91cecfc
|
7
|
+
data.tar.gz: b7f709ec3f6bf5dfae9fb13f21b226586b51fe53685d20f07d1e49bcd4653bc18478497eb1118a8d09ce469fad0ca87935a21c6bf4481a11ceab1189c20b6ba2
|
data/lib/flow-reference.rb
CHANGED
@@ -6,7 +6,7 @@ require_relative 'generated/continents'
|
|
6
6
|
require_relative 'generated/languages'
|
7
7
|
require_relative 'generated/payment_methods'
|
8
8
|
|
9
|
-
module
|
9
|
+
module FlowCommerce
|
10
10
|
module Reference
|
11
11
|
class Currencies
|
12
12
|
class << self
|
@@ -99,7 +99,7 @@ module Flow
|
|
99
99
|
end
|
100
100
|
end
|
101
101
|
|
102
|
-
module Io::
|
102
|
+
module Io::FlowCommerce::Reference::V0::Models
|
103
103
|
class Currency
|
104
104
|
def to_cents(amount_in)
|
105
105
|
amount = amount_in.to_f
|
@@ -118,7 +118,7 @@ module Io::Flow::Reference::V0::Models
|
|
118
118
|
class Country
|
119
119
|
def locales
|
120
120
|
list = 'country_%s' % @iso_3166_3.downcase
|
121
|
-
ref = ::
|
121
|
+
ref = ::FlowCommerce::Reference::Locales::Data
|
122
122
|
ref.respond_to?(list) ? ref.send(list) : nil
|
123
123
|
end
|
124
124
|
end
|
@@ -16,7 +16,7 @@ require 'bigdecimal'
|
|
16
16
|
# Reference data that changes infrequently including countries, currencies,
|
17
17
|
# languages, etc.
|
18
18
|
module Io
|
19
|
-
module
|
19
|
+
module FlowCommerce
|
20
20
|
module Reference
|
21
21
|
module V0
|
22
22
|
|
@@ -66,35 +66,35 @@ module Io
|
|
66
66
|
end
|
67
67
|
|
68
68
|
def countries
|
69
|
-
@countries ||= ::Io::
|
69
|
+
@countries ||= ::Io::FlowCommerce::Reference::V0::Clients::Countries.new(self)
|
70
70
|
end
|
71
71
|
|
72
72
|
def currencies
|
73
|
-
@currencies ||= ::Io::
|
73
|
+
@currencies ||= ::Io::FlowCommerce::Reference::V0::Clients::Currencies.new(self)
|
74
74
|
end
|
75
75
|
|
76
76
|
def languages
|
77
|
-
@languages ||= ::Io::
|
77
|
+
@languages ||= ::Io::FlowCommerce::Reference::V0::Clients::Languages.new(self)
|
78
78
|
end
|
79
79
|
|
80
80
|
def locales
|
81
|
-
@locales ||= ::Io::
|
81
|
+
@locales ||= ::Io::FlowCommerce::Reference::V0::Clients::Locales.new(self)
|
82
82
|
end
|
83
83
|
|
84
84
|
def payment_methods
|
85
|
-
@payment_methods ||= ::Io::
|
85
|
+
@payment_methods ||= ::Io::FlowCommerce::Reference::V0::Clients::PaymentMethods.new(self)
|
86
86
|
end
|
87
87
|
|
88
88
|
def provinces
|
89
|
-
@provinces ||= ::Io::
|
89
|
+
@provinces ||= ::Io::FlowCommerce::Reference::V0::Clients::Provinces.new(self)
|
90
90
|
end
|
91
91
|
|
92
92
|
def regions
|
93
|
-
@regions ||= ::Io::
|
93
|
+
@regions ||= ::Io::FlowCommerce::Reference::V0::Clients::Regions.new(self)
|
94
94
|
end
|
95
95
|
|
96
96
|
def timezones
|
97
|
-
@timezones ||= ::Io::
|
97
|
+
@timezones ||= ::Io::FlowCommerce::Reference::V0::Clients::Timezones.new(self)
|
98
98
|
end
|
99
99
|
end
|
100
100
|
|
@@ -103,7 +103,7 @@ module Io
|
|
103
103
|
class Countries
|
104
104
|
|
105
105
|
def initialize(client)
|
106
|
-
@client = HttpClient::Preconditions.assert_class('client', client, ::Io::
|
106
|
+
@client = HttpClient::Preconditions.assert_class('client', client, ::Io::FlowCommerce::Reference::V0::Client)
|
107
107
|
end
|
108
108
|
|
109
109
|
# Returns a list of countries.
|
@@ -113,7 +113,7 @@ module Io
|
|
113
113
|
:q => (x = opts.delete(:q); x.nil? ? nil : HttpClient::Preconditions.assert_class('q', x, String))
|
114
114
|
}.delete_if { |k, v| v.nil? }
|
115
115
|
r = @client.request("/reference/countries").with_query(query).get
|
116
|
-
r.map { |x| ::Io::
|
116
|
+
r.map { |x| ::Io::FlowCommerce::Reference::V0::Models::Country.new(x) }
|
117
117
|
end
|
118
118
|
|
119
119
|
end
|
@@ -121,7 +121,7 @@ module Io
|
|
121
121
|
class Currencies
|
122
122
|
|
123
123
|
def initialize(client)
|
124
|
-
@client = HttpClient::Preconditions.assert_class('client', client, ::Io::
|
124
|
+
@client = HttpClient::Preconditions.assert_class('client', client, ::Io::FlowCommerce::Reference::V0::Client)
|
125
125
|
end
|
126
126
|
|
127
127
|
# Returns a list of currencies.
|
@@ -131,7 +131,7 @@ module Io
|
|
131
131
|
:q => (x = opts.delete(:q); x.nil? ? nil : HttpClient::Preconditions.assert_class('q', x, String))
|
132
132
|
}.delete_if { |k, v| v.nil? }
|
133
133
|
r = @client.request("/reference/currencies").with_query(query).get
|
134
|
-
r.map { |x| ::Io::
|
134
|
+
r.map { |x| ::Io::FlowCommerce::Reference::V0::Models::Currency.new(x) }
|
135
135
|
end
|
136
136
|
|
137
137
|
end
|
@@ -139,7 +139,7 @@ module Io
|
|
139
139
|
class Languages
|
140
140
|
|
141
141
|
def initialize(client)
|
142
|
-
@client = HttpClient::Preconditions.assert_class('client', client, ::Io::
|
142
|
+
@client = HttpClient::Preconditions.assert_class('client', client, ::Io::FlowCommerce::Reference::V0::Client)
|
143
143
|
end
|
144
144
|
|
145
145
|
# Returns a list of languages.
|
@@ -149,7 +149,7 @@ module Io
|
|
149
149
|
:q => (x = opts.delete(:q); x.nil? ? nil : HttpClient::Preconditions.assert_class('q', x, String))
|
150
150
|
}.delete_if { |k, v| v.nil? }
|
151
151
|
r = @client.request("/reference/languages").with_query(query).get
|
152
|
-
r.map { |x| ::Io::
|
152
|
+
r.map { |x| ::Io::FlowCommerce::Reference::V0::Models::Language.new(x) }
|
153
153
|
end
|
154
154
|
|
155
155
|
end
|
@@ -157,7 +157,7 @@ module Io
|
|
157
157
|
class Locales
|
158
158
|
|
159
159
|
def initialize(client)
|
160
|
-
@client = HttpClient::Preconditions.assert_class('client', client, ::Io::
|
160
|
+
@client = HttpClient::Preconditions.assert_class('client', client, ::Io::FlowCommerce::Reference::V0::Client)
|
161
161
|
end
|
162
162
|
|
163
163
|
# Returns a list of locales.
|
@@ -167,14 +167,14 @@ module Io
|
|
167
167
|
:q => (x = opts.delete(:q); x.nil? ? nil : HttpClient::Preconditions.assert_class('q', x, String))
|
168
168
|
}.delete_if { |k, v| v.nil? }
|
169
169
|
r = @client.request("/reference/locales").with_query(query).get
|
170
|
-
r.map { |x| ::Io::
|
170
|
+
r.map { |x| ::Io::FlowCommerce::Reference::V0::Models::Locale.new(x) }
|
171
171
|
end
|
172
172
|
|
173
173
|
# Returns the locale with the specifed id.
|
174
174
|
def get_by_id(id)
|
175
175
|
HttpClient::Preconditions.assert_class('id', id, String)
|
176
176
|
r = @client.request("/reference/locales/#{CGI.escape(id)}").get
|
177
|
-
::Io::
|
177
|
+
::Io::FlowCommerce::Reference::V0::Models::Locale.new(r)
|
178
178
|
end
|
179
179
|
|
180
180
|
end
|
@@ -182,7 +182,7 @@ module Io
|
|
182
182
|
class PaymentMethods
|
183
183
|
|
184
184
|
def initialize(client)
|
185
|
-
@client = HttpClient::Preconditions.assert_class('client', client, ::Io::
|
185
|
+
@client = HttpClient::Preconditions.assert_class('client', client, ::Io::FlowCommerce::Reference::V0::Client)
|
186
186
|
end
|
187
187
|
|
188
188
|
# Returns a list of payment methods supported by Flow.
|
@@ -192,7 +192,7 @@ module Io
|
|
192
192
|
:q => (x = opts.delete(:q); x.nil? ? nil : HttpClient::Preconditions.assert_class('q', x, String))
|
193
193
|
}.delete_if { |k, v| v.nil? }
|
194
194
|
r = @client.request("/reference/payment-methods").with_query(query).get
|
195
|
-
r.map { |x| ::Io::
|
195
|
+
r.map { |x| ::Io::FlowCommerce::Reference::V0::Models::PaymentMethod.new(x) }
|
196
196
|
end
|
197
197
|
|
198
198
|
end
|
@@ -200,7 +200,7 @@ module Io
|
|
200
200
|
class Provinces
|
201
201
|
|
202
202
|
def initialize(client)
|
203
|
-
@client = HttpClient::Preconditions.assert_class('client', client, ::Io::
|
203
|
+
@client = HttpClient::Preconditions.assert_class('client', client, ::Io::FlowCommerce::Reference::V0::Client)
|
204
204
|
end
|
205
205
|
|
206
206
|
# Returns a list of provinces.
|
@@ -211,14 +211,14 @@ module Io
|
|
211
211
|
:countries => (x = opts.delete(:countries); x.nil? ? nil : HttpClient::Preconditions.assert_class('countries', x, Array).map { |v| HttpClient::Preconditions.assert_class('countries', v, String) })
|
212
212
|
}.delete_if { |k, v| v.nil? }
|
213
213
|
r = @client.request("/reference/provinces").with_query(query).get
|
214
|
-
r.map { |x| ::Io::
|
214
|
+
r.map { |x| ::Io::FlowCommerce::Reference::V0::Models::Province.new(x) }
|
215
215
|
end
|
216
216
|
|
217
217
|
# Returns the province with the specifed id.
|
218
218
|
def get_by_id(id)
|
219
219
|
HttpClient::Preconditions.assert_class('id', id, String)
|
220
220
|
r = @client.request("/reference/provinces/#{CGI.escape(id)}").get
|
221
|
-
::Io::
|
221
|
+
::Io::FlowCommerce::Reference::V0::Models::Province.new(r)
|
222
222
|
end
|
223
223
|
|
224
224
|
end
|
@@ -226,7 +226,7 @@ module Io
|
|
226
226
|
class Regions
|
227
227
|
|
228
228
|
def initialize(client)
|
229
|
-
@client = HttpClient::Preconditions.assert_class('client', client, ::Io::
|
229
|
+
@client = HttpClient::Preconditions.assert_class('client', client, ::Io::FlowCommerce::Reference::V0::Client)
|
230
230
|
end
|
231
231
|
|
232
232
|
# Returns a list of regions.
|
@@ -236,14 +236,14 @@ module Io
|
|
236
236
|
:q => (x = opts.delete(:q); x.nil? ? nil : HttpClient::Preconditions.assert_class('q', x, String))
|
237
237
|
}.delete_if { |k, v| v.nil? }
|
238
238
|
r = @client.request("/reference/regions").with_query(query).get
|
239
|
-
r.map { |x| ::Io::
|
239
|
+
r.map { |x| ::Io::FlowCommerce::Reference::V0::Models::Region.new(x) }
|
240
240
|
end
|
241
241
|
|
242
242
|
# Returns the region with the specifed id.
|
243
243
|
def get_by_id(id)
|
244
244
|
HttpClient::Preconditions.assert_class('id', id, String)
|
245
245
|
r = @client.request("/reference/regions/#{CGI.escape(id)}").get
|
246
|
-
::Io::
|
246
|
+
::Io::FlowCommerce::Reference::V0::Models::Region.new(r)
|
247
247
|
end
|
248
248
|
|
249
249
|
end
|
@@ -251,7 +251,7 @@ module Io
|
|
251
251
|
class Timezones
|
252
252
|
|
253
253
|
def initialize(client)
|
254
|
-
@client = HttpClient::Preconditions.assert_class('client', client, ::Io::
|
254
|
+
@client = HttpClient::Preconditions.assert_class('client', client, ::Io::FlowCommerce::Reference::V0::Client)
|
255
255
|
end
|
256
256
|
|
257
257
|
# Returns a list of timezones.
|
@@ -261,7 +261,7 @@ module Io
|
|
261
261
|
:q => (x = opts.delete(:q); x.nil? ? nil : HttpClient::Preconditions.assert_class('q', x, String))
|
262
262
|
}.delete_if { |k, v| v.nil? }
|
263
263
|
r = @client.request("/reference/timezones").with_query(query).get
|
264
|
-
r.map { |x| ::Io::
|
264
|
+
r.map { |x| ::Io::FlowCommerce::Reference::V0::Models::Timezone.new(x) }
|
265
265
|
end
|
266
266
|
|
267
267
|
end
|
@@ -445,7 +445,7 @@ module Io
|
|
445
445
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
446
446
|
HttpClient::Preconditions.require_keys(opts, [:id, :carrier, :name], 'CarrierService')
|
447
447
|
@id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
|
448
|
-
@carrier = (x = opts.delete(:carrier); x.is_a?(::Io::
|
448
|
+
@carrier = (x = opts.delete(:carrier); x.is_a?(::Io::FlowCommerce::Reference::V0::Models::Carrier) ? x : ::Io::FlowCommerce::Reference::V0::Models::Carrier.new(x))
|
449
449
|
@name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
|
450
450
|
end
|
451
451
|
|
@@ -522,7 +522,7 @@ module Io
|
|
522
522
|
@name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
|
523
523
|
@iso_4217_3 = HttpClient::Preconditions.assert_class('iso_4217_3', opts.delete(:iso_4217_3), String)
|
524
524
|
@number_decimals = HttpClient::Preconditions.assert_class('number_decimals', opts.delete(:number_decimals), Integer)
|
525
|
-
@symbols = (x = opts.delete(:symbols); x.nil? ? nil : (x = x; x.is_a?(::Io::
|
525
|
+
@symbols = (x = opts.delete(:symbols); x.nil? ? nil : (x = x; x.is_a?(::Io::FlowCommerce::Reference::V0::Models::CurrencySymbols) ? x : ::Io::FlowCommerce::Reference::V0::Models::CurrencySymbols.new(x)))
|
526
526
|
@default_locale = (x = opts.delete(:default_locale); x.nil? ? nil : HttpClient::Preconditions.assert_class('default_locale', x, String))
|
527
527
|
end
|
528
528
|
|
@@ -617,7 +617,7 @@ module Io
|
|
617
617
|
@name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
|
618
618
|
@country = HttpClient::Preconditions.assert_class('country', opts.delete(:country), String)
|
619
619
|
@language = HttpClient::Preconditions.assert_class('language', opts.delete(:language), String)
|
620
|
-
@numbers = (x = opts.delete(:numbers); x.is_a?(::Io::
|
620
|
+
@numbers = (x = opts.delete(:numbers); x.is_a?(::Io::FlowCommerce::Reference::V0::Models::LocaleNumbers) ? x : ::Io::FlowCommerce::Reference::V0::Models::LocaleNumbers.new(x))
|
621
621
|
end
|
622
622
|
|
623
623
|
def to_json
|
@@ -677,7 +677,7 @@ module Io
|
|
677
677
|
def initialize(incoming={})
|
678
678
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
679
679
|
HttpClient::Preconditions.require_keys(opts, [:locale, :name], 'LocalizedTranslation')
|
680
|
-
@locale = (x = opts.delete(:locale); x.is_a?(::Io::
|
680
|
+
@locale = (x = opts.delete(:locale); x.is_a?(::Io::FlowCommerce::Reference::V0::Models::Locale) ? x : ::Io::FlowCommerce::Reference::V0::Models::Locale.new(x))
|
681
681
|
@name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
|
682
682
|
end
|
683
683
|
|
@@ -708,9 +708,9 @@ module Io
|
|
708
708
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
709
709
|
HttpClient::Preconditions.require_keys(opts, [:id, :type, :name, :images, :regions], 'PaymentMethod')
|
710
710
|
@id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
|
711
|
-
@type = (x = opts.delete(:type); x.is_a?(::Io::
|
711
|
+
@type = (x = opts.delete(:type); x.is_a?(::Io::FlowCommerce::Reference::V0::Models::PaymentMethodType) ? x : ::Io::FlowCommerce::Reference::V0::Models::PaymentMethodType.apply(x))
|
712
712
|
@name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
|
713
|
-
@images = (x = opts.delete(:images); x.is_a?(::Io::
|
713
|
+
@images = (x = opts.delete(:images); x.is_a?(::Io::FlowCommerce::Reference::V0::Models::PaymentMethodImages) ? x : ::Io::FlowCommerce::Reference::V0::Models::PaymentMethodImages.new(x))
|
714
714
|
@regions = HttpClient::Preconditions.assert_class('regions', opts.delete(:regions), Array).map { |v| HttpClient::Preconditions.assert_class('regions', v, String) }
|
715
715
|
end
|
716
716
|
|
@@ -771,9 +771,9 @@ module Io
|
|
771
771
|
def initialize(incoming={})
|
772
772
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
773
773
|
HttpClient::Preconditions.require_keys(opts, [:small, :medium, :large], 'PaymentMethodImages')
|
774
|
-
@small = (x = opts.delete(:small); x.is_a?(::Io::
|
775
|
-
@medium = (x = opts.delete(:medium); x.is_a?(::Io::
|
776
|
-
@large = (x = opts.delete(:large); x.is_a?(::Io::
|
774
|
+
@small = (x = opts.delete(:small); x.is_a?(::Io::FlowCommerce::Reference::V0::Models::PaymentMethodImage) ? x : ::Io::FlowCommerce::Reference::V0::Models::PaymentMethodImage.new(x))
|
775
|
+
@medium = (x = opts.delete(:medium); x.is_a?(::Io::FlowCommerce::Reference::V0::Models::PaymentMethodImage) ? x : ::Io::FlowCommerce::Reference::V0::Models::PaymentMethodImage.new(x))
|
776
|
+
@large = (x = opts.delete(:large); x.is_a?(::Io::FlowCommerce::Reference::V0::Models::PaymentMethodImage) ? x : ::Io::FlowCommerce::Reference::V0::Models::PaymentMethodImage.new(x))
|
777
777
|
end
|
778
778
|
|
779
779
|
def to_json
|
@@ -807,8 +807,8 @@ module Io
|
|
807
807
|
@iso_3166_2 = HttpClient::Preconditions.assert_class('iso_3166_2', opts.delete(:iso_3166_2), String)
|
808
808
|
@name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
|
809
809
|
@country = HttpClient::Preconditions.assert_class('country', opts.delete(:country), String)
|
810
|
-
@province_type = (x = opts.delete(:province_type); x.is_a?(::Io::
|
811
|
-
@translations = (x = opts.delete(:translations); x.nil? ? nil : HttpClient::Preconditions.assert_class('translations', x, Array).map { |v| (x = v; x.is_a?(::Io::
|
810
|
+
@province_type = (x = opts.delete(:province_type); x.is_a?(::Io::FlowCommerce::Reference::V0::Models::ProvinceType) ? x : ::Io::FlowCommerce::Reference::V0::Models::ProvinceType.apply(x))
|
811
|
+
@translations = (x = opts.delete(:translations); x.nil? ? nil : HttpClient::Preconditions.assert_class('translations', x, Array).map { |v| (x = v; x.is_a?(::Io::FlowCommerce::Reference::V0::Models::LocalizedTranslation) ? x : ::Io::FlowCommerce::Reference::V0::Models::LocalizedTranslation.new(x)) })
|
812
812
|
end
|
813
813
|
|
814
814
|
def to_json
|
data/lib/generated/continents.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Generated by Flow.io (2017) code builder
|
2
2
|
|
3
3
|
# untill we define it in auto generator
|
4
|
-
class ::Io::
|
4
|
+
class ::Io::FlowCommerce::Reference::V0::Models::Continent
|
5
5
|
attr_accessor :name
|
6
6
|
attr_accessor :code
|
7
7
|
attr_accessor :country_codes
|
@@ -14,18 +14,18 @@ class ::Io::Flow::Reference::V0::Models::Continent
|
|
14
14
|
|
15
15
|
def countries
|
16
16
|
@country_codes.map do |country|
|
17
|
-
|
17
|
+
FlowCommerce::Reference::Countries.find(country)
|
18
18
|
end
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
22
|
-
module
|
22
|
+
module FlowCommerce
|
23
23
|
module Reference
|
24
24
|
class Continents
|
25
25
|
class Data
|
26
26
|
class << self
|
27
27
|
def new_c(hash)
|
28
|
-
::Io::
|
28
|
+
::Io::FlowCommerce::Reference::V0::Models::Continent.new(hash)
|
29
29
|
end
|
30
30
|
|
31
31
|
def Afr
|
data/lib/generated/countries.rb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
# Generated by Flow.io (2017) code builder
|
2
2
|
|
3
|
-
module
|
3
|
+
module FlowCommerce
|
4
4
|
module Reference
|
5
5
|
class Locales
|
6
6
|
class Data
|
7
7
|
class << self
|
8
8
|
def new_l(hash)
|
9
|
-
::Io::
|
9
|
+
::Io::FlowCommerce::Reference::V0::Models::Locale.new(hash)
|
10
10
|
end
|
11
11
|
|
12
12
|
def country_nam
|
@@ -2088,7 +2088,7 @@ module Flow
|
|
2088
2088
|
class Data
|
2089
2089
|
class << self
|
2090
2090
|
def new_c(hash)
|
2091
|
-
::Io::
|
2091
|
+
::Io::FlowCommerce::Reference::V0::Models::Country.new(hash)
|
2092
2092
|
end
|
2093
2093
|
|
2094
2094
|
def Alb
|
data/lib/generated/currencies.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
# Generated by Flow.io (2017) code builder
|
2
2
|
|
3
|
-
module
|
3
|
+
module FlowCommerce
|
4
4
|
module Reference
|
5
5
|
class Currencies
|
6
6
|
class Data
|
7
7
|
def Data.new_c(hash)
|
8
|
-
::Io::
|
8
|
+
::Io::FlowCommerce::Reference::V0::Models::Currency.new(hash)
|
9
9
|
end
|
10
10
|
|
11
11
|
def Data.All
|
data/lib/generated/languages.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
# Generated by Flow.io (2017) code builder
|
2
2
|
|
3
|
-
module
|
3
|
+
module FlowCommerce
|
4
4
|
module Reference
|
5
5
|
class Languages
|
6
6
|
class Data
|
7
7
|
def Data.new_l(hash)
|
8
|
-
::Io::
|
8
|
+
::Io::FlowCommerce::Reference::V0::Models::Language.new(hash)
|
9
9
|
end
|
10
10
|
|
11
11
|
def Data.Aa
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# Generated by Flow.io (2017) code builder
|
2
2
|
|
3
|
-
module
|
3
|
+
module FlowCommerce
|
4
4
|
module Reference
|
5
5
|
class PaymentMethods
|
6
6
|
SUPPORTED_CREDIT_CARDS = [:ach, :alipay, :american_express, :bankTransfer_IBAN, :bitcoin, :bitpay, :cartes_bancaires, :china_union_pay, :dankort, :diners_club, :directEbanking, :discover, :dotpay, :dragonpay_ebanking, :dragonpay_gcash, :dragonpay_otc_banking, :ebanking_FI, :giropay, :ideal, :interac, :jcb, :kcp_banktransfer, :kcp_creditcard, :kcp_payco, :klarna, :maestro, :mastercard, :molpay_points, :multibanco, :paypal, :qiwiwallet, :sepadirectdebit, :trustly, :trustpay, :unionpay, :visa, :wechatpay]
|
@@ -8,7 +8,7 @@ module Flow
|
|
8
8
|
class Data
|
9
9
|
class << self
|
10
10
|
def new_pm(hash)
|
11
|
-
::Io::
|
11
|
+
::Io::FlowCommerce::Reference::V0::Models::PaymentMethod.new(hash)
|
12
12
|
end
|
13
13
|
|
14
14
|
def Ach
|
data/lib/io_flow_reference_v0.rb
CHANGED
@@ -16,7 +16,7 @@ require 'bigdecimal'
|
|
16
16
|
# Reference data that changes infrequently including countries, currencies,
|
17
17
|
# languages, etc.
|
18
18
|
module Io
|
19
|
-
module
|
19
|
+
module FlowCommerce
|
20
20
|
module Reference
|
21
21
|
module V0
|
22
22
|
|
@@ -66,27 +66,27 @@ module Io
|
|
66
66
|
end
|
67
67
|
|
68
68
|
def countries
|
69
|
-
@countries ||= ::Io::
|
69
|
+
@countries ||= ::Io::FlowCommerce::Reference::V0::Clients::Countries.new(self)
|
70
70
|
end
|
71
71
|
|
72
72
|
def currencies
|
73
|
-
@currencies ||= ::Io::
|
73
|
+
@currencies ||= ::Io::FlowCommerce::Reference::V0::Clients::Currencies.new(self)
|
74
74
|
end
|
75
75
|
|
76
76
|
def languages
|
77
|
-
@languages ||= ::Io::
|
77
|
+
@languages ||= ::Io::FlowCommerce::Reference::V0::Clients::Languages.new(self)
|
78
78
|
end
|
79
79
|
|
80
80
|
def locales
|
81
|
-
@locales ||= ::Io::
|
81
|
+
@locales ||= ::Io::FlowCommerce::Reference::V0::Clients::Locales.new(self)
|
82
82
|
end
|
83
83
|
|
84
84
|
def regions
|
85
|
-
@regions ||= ::Io::
|
85
|
+
@regions ||= ::Io::FlowCommerce::Reference::V0::Clients::Regions.new(self)
|
86
86
|
end
|
87
87
|
|
88
88
|
def timezones
|
89
|
-
@timezones ||= ::Io::
|
89
|
+
@timezones ||= ::Io::FlowCommerce::Reference::V0::Clients::Timezones.new(self)
|
90
90
|
end
|
91
91
|
end
|
92
92
|
|
@@ -95,7 +95,7 @@ module Io
|
|
95
95
|
class Countries
|
96
96
|
|
97
97
|
def initialize(client)
|
98
|
-
@client = HttpClient::Preconditions.assert_class('client', client, ::Io::
|
98
|
+
@client = HttpClient::Preconditions.assert_class('client', client, ::Io::FlowCommerce::Reference::V0::Client)
|
99
99
|
end
|
100
100
|
|
101
101
|
# Returns a list of countries.
|
@@ -105,7 +105,7 @@ module Io
|
|
105
105
|
:q => (x = opts.delete(:q); x.nil? ? nil : HttpClient::Preconditions.assert_class('q', x, String))
|
106
106
|
}.delete_if { |k, v| v.nil? }
|
107
107
|
r = @client.request("/reference/countries").with_query(query).get
|
108
|
-
r.map { |x| ::Io::
|
108
|
+
r.map { |x| ::Io::FlowCommerce::Reference::V0::Models::Country.new(x) }
|
109
109
|
end
|
110
110
|
|
111
111
|
end
|
@@ -113,7 +113,7 @@ module Io
|
|
113
113
|
class Currencies
|
114
114
|
|
115
115
|
def initialize(client)
|
116
|
-
@client = HttpClient::Preconditions.assert_class('client', client, ::Io::
|
116
|
+
@client = HttpClient::Preconditions.assert_class('client', client, ::Io::FlowCommerce::Reference::V0::Client)
|
117
117
|
end
|
118
118
|
|
119
119
|
# Returns a list of currencies.
|
@@ -123,7 +123,7 @@ module Io
|
|
123
123
|
:q => (x = opts.delete(:q); x.nil? ? nil : HttpClient::Preconditions.assert_class('q', x, String))
|
124
124
|
}.delete_if { |k, v| v.nil? }
|
125
125
|
r = @client.request("/reference/currencies").with_query(query).get
|
126
|
-
r.map { |x| ::Io::
|
126
|
+
r.map { |x| ::Io::FlowCommerce::Reference::V0::Models::Currency.new(x) }
|
127
127
|
end
|
128
128
|
|
129
129
|
end
|
@@ -131,7 +131,7 @@ module Io
|
|
131
131
|
class Languages
|
132
132
|
|
133
133
|
def initialize(client)
|
134
|
-
@client = HttpClient::Preconditions.assert_class('client', client, ::Io::
|
134
|
+
@client = HttpClient::Preconditions.assert_class('client', client, ::Io::FlowCommerce::Reference::V0::Client)
|
135
135
|
end
|
136
136
|
|
137
137
|
# Returns a list of languages.
|
@@ -141,7 +141,7 @@ module Io
|
|
141
141
|
:q => (x = opts.delete(:q); x.nil? ? nil : HttpClient::Preconditions.assert_class('q', x, String))
|
142
142
|
}.delete_if { |k, v| v.nil? }
|
143
143
|
r = @client.request("/reference/languages").with_query(query).get
|
144
|
-
r.map { |x| ::Io::
|
144
|
+
r.map { |x| ::Io::FlowCommerce::Reference::V0::Models::Language.new(x) }
|
145
145
|
end
|
146
146
|
|
147
147
|
end
|
@@ -149,7 +149,7 @@ module Io
|
|
149
149
|
class Locales
|
150
150
|
|
151
151
|
def initialize(client)
|
152
|
-
@client = HttpClient::Preconditions.assert_class('client', client, ::Io::
|
152
|
+
@client = HttpClient::Preconditions.assert_class('client', client, ::Io::FlowCommerce::Reference::V0::Client)
|
153
153
|
end
|
154
154
|
|
155
155
|
# Returns a list of locales.
|
@@ -159,14 +159,14 @@ module Io
|
|
159
159
|
:q => (x = opts.delete(:q); x.nil? ? nil : HttpClient::Preconditions.assert_class('q', x, String))
|
160
160
|
}.delete_if { |k, v| v.nil? }
|
161
161
|
r = @client.request("/reference/locales").with_query(query).get
|
162
|
-
r.map { |x| ::Io::
|
162
|
+
r.map { |x| ::Io::FlowCommerce::Reference::V0::Models::Locale.new(x) }
|
163
163
|
end
|
164
164
|
|
165
165
|
# Returns the locale with the specifed id.
|
166
166
|
def get_by_id(id)
|
167
167
|
HttpClient::Preconditions.assert_class('id', id, String)
|
168
168
|
r = @client.request("/reference/locales/#{CGI.escape(id)}").get
|
169
|
-
::Io::
|
169
|
+
::Io::FlowCommerce::Reference::V0::Models::Locale.new(r)
|
170
170
|
end
|
171
171
|
|
172
172
|
end
|
@@ -174,7 +174,7 @@ module Io
|
|
174
174
|
class Regions
|
175
175
|
|
176
176
|
def initialize(client)
|
177
|
-
@client = HttpClient::Preconditions.assert_class('client', client, ::Io::
|
177
|
+
@client = HttpClient::Preconditions.assert_class('client', client, ::Io::FlowCommerce::Reference::V0::Client)
|
178
178
|
end
|
179
179
|
|
180
180
|
# Returns a list of regions.
|
@@ -184,14 +184,14 @@ module Io
|
|
184
184
|
:q => (x = opts.delete(:q); x.nil? ? nil : HttpClient::Preconditions.assert_class('q', x, String))
|
185
185
|
}.delete_if { |k, v| v.nil? }
|
186
186
|
r = @client.request("/reference/regions").with_query(query).get
|
187
|
-
r.map { |x| ::Io::
|
187
|
+
r.map { |x| ::Io::FlowCommerce::Reference::V0::Models::Region.new(x) }
|
188
188
|
end
|
189
189
|
|
190
190
|
# Returns the region with the specifed id.
|
191
191
|
def get_by_id(id)
|
192
192
|
HttpClient::Preconditions.assert_class('id', id, String)
|
193
193
|
r = @client.request("/reference/regions/#{CGI.escape(id)}").get
|
194
|
-
::Io::
|
194
|
+
::Io::FlowCommerce::Reference::V0::Models::Region.new(r)
|
195
195
|
end
|
196
196
|
|
197
197
|
end
|
@@ -199,7 +199,7 @@ module Io
|
|
199
199
|
class Timezones
|
200
200
|
|
201
201
|
def initialize(client)
|
202
|
-
@client = HttpClient::Preconditions.assert_class('client', client, ::Io::
|
202
|
+
@client = HttpClient::Preconditions.assert_class('client', client, ::Io::FlowCommerce::Reference::V0::Client)
|
203
203
|
end
|
204
204
|
|
205
205
|
# Returns a list of timezones.
|
@@ -209,7 +209,7 @@ module Io
|
|
209
209
|
:q => (x = opts.delete(:q); x.nil? ? nil : HttpClient::Preconditions.assert_class('q', x, String))
|
210
210
|
}.delete_if { |k, v| v.nil? }
|
211
211
|
r = @client.request("/reference/timezones").with_query(query).get
|
212
|
-
r.map { |x| ::Io::
|
212
|
+
r.map { |x| ::Io::FlowCommerce::Reference::V0::Models::Timezone.new(x) }
|
213
213
|
end
|
214
214
|
|
215
215
|
end
|
@@ -324,7 +324,7 @@ module Io
|
|
324
324
|
@name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
|
325
325
|
@iso_4217_3 = HttpClient::Preconditions.assert_class('iso_4217_3', opts.delete(:iso_4217_3), String)
|
326
326
|
@number_decimals = HttpClient::Preconditions.assert_class('number_decimals', opts.delete(:number_decimals), Integer)
|
327
|
-
@symbols = (x = opts.delete(:symbols); x.nil? ? nil : (x = x; x.is_a?(::Io::
|
327
|
+
@symbols = (x = opts.delete(:symbols); x.nil? ? nil : (x = x; x.is_a?(::Io::FlowCommerce::Reference::V0::Models::CurrencySymbols) ? x : ::Io::FlowCommerce::Reference::V0::Models::CurrencySymbols.new(x)))
|
328
328
|
@default_locale = (x = opts.delete(:default_locale); x.nil? ? nil : HttpClient::Preconditions.assert_class('default_locale', x, String))
|
329
329
|
end
|
330
330
|
|
@@ -419,7 +419,7 @@ module Io
|
|
419
419
|
@name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
|
420
420
|
@country = HttpClient::Preconditions.assert_class('country', opts.delete(:country), String)
|
421
421
|
@language = HttpClient::Preconditions.assert_class('language', opts.delete(:language), String)
|
422
|
-
@numbers = (x = opts.delete(:numbers); x.is_a?(::Io::
|
422
|
+
@numbers = (x = opts.delete(:numbers); x.is_a?(::Io::FlowCommerce::Reference::V0::Models::LocaleNumbers) ? x : ::Io::FlowCommerce::Reference::V0::Models::LocaleNumbers.new(x))
|
423
423
|
end
|
424
424
|
|
425
425
|
def to_json
|
@@ -481,9 +481,9 @@ module Io
|
|
481
481
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
482
482
|
HttpClient::Preconditions.require_keys(opts, [:id, :type, :name, :images, :regions], 'PaymentMethod')
|
483
483
|
@id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
|
484
|
-
@type = (x = opts.delete(:type); x.is_a?(::Io::
|
484
|
+
@type = (x = opts.delete(:type); x.is_a?(::Io::FlowCommerce::Reference::V0::Models::PaymentMethodType) ? x : ::Io::FlowCommerce::Reference::V0::Models::PaymentMethodType.apply(x))
|
485
485
|
@name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
|
486
|
-
@images = (x = opts.delete(:images); x.is_a?(::Io::
|
486
|
+
@images = (x = opts.delete(:images); x.is_a?(::Io::FlowCommerce::Reference::V0::Models::PaymentMethodImages) ? x : ::Io::FlowCommerce::Reference::V0::Models::PaymentMethodImages.new(x))
|
487
487
|
@regions = HttpClient::Preconditions.assert_class('regions', opts.delete(:regions), Array).map { |v| HttpClient::Preconditions.assert_class('regions', v, String) }
|
488
488
|
end
|
489
489
|
|
@@ -544,9 +544,9 @@ module Io
|
|
544
544
|
def initialize(incoming={})
|
545
545
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
546
546
|
HttpClient::Preconditions.require_keys(opts, [:small, :medium, :large], 'PaymentMethodImages')
|
547
|
-
@small = (x = opts.delete(:small); x.is_a?(::Io::
|
548
|
-
@medium = (x = opts.delete(:medium); x.is_a?(::Io::
|
549
|
-
@large = (x = opts.delete(:large); x.is_a?(::Io::
|
547
|
+
@small = (x = opts.delete(:small); x.is_a?(::Io::FlowCommerce::Reference::V0::Models::PaymentMethodImage) ? x : ::Io::FlowCommerce::Reference::V0::Models::PaymentMethodImage.new(x))
|
548
|
+
@medium = (x = opts.delete(:medium); x.is_a?(::Io::FlowCommerce::Reference::V0::Models::PaymentMethodImage) ? x : ::Io::FlowCommerce::Reference::V0::Models::PaymentMethodImage.new(x))
|
549
|
+
@large = (x = opts.delete(:large); x.is_a?(::Io::FlowCommerce::Reference::V0::Models::PaymentMethodImage) ? x : ::Io::FlowCommerce::Reference::V0::Models::PaymentMethodImage.new(x))
|
550
550
|
end
|
551
551
|
|
552
552
|
def to_json
|
data/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flowcommerce-reference
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Bryzek
|
@@ -11,8 +11,9 @@ bindir: bin
|
|
11
11
|
cert_chain: []
|
12
12
|
date: 2018-07-12 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
|
-
description:
|
15
|
-
|
14
|
+
description: Simple native Ruby Library to browse ISO data related to countries, currencies,
|
15
|
+
languages, etc.
|
16
|
+
email: tech@flow.io
|
16
17
|
executables: []
|
17
18
|
extensions: []
|
18
19
|
extra_rdoc_files: []
|
@@ -49,5 +50,5 @@ rubyforge_project:
|
|
49
50
|
rubygems_version: 2.5.2
|
50
51
|
signing_key:
|
51
52
|
specification_version: 4
|
52
|
-
summary: Flow
|
53
|
+
summary: Flow Commerce Ruby Library of ISO reference data
|
53
54
|
test_files: []
|