Class: Io::Flow::V0::Clients::Countries
- Inherits:
-
Object
- Object
- Io::Flow::V0::Clients::Countries
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Method Summary collapse
-
#get(incoming = {}) ⇒ Object
Returns a list of countries.
-
#initialize(client) ⇒ Countries
constructor
A new instance of Countries.
Constructor Details
#initialize(client) ⇒ Countries
Returns a new instance of Countries.
3626 3627 3628 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 3626 def initialize(client) @client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client) end |
Instance Method Details
#get(incoming = {}) ⇒ Object
Returns a list of countries.
3631 3632 3633 3634 3635 3636 3637 3638 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 3631 def get(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) query = { :q => (x = opts.delete(:q); x.nil? ? nil : HttpClient::Preconditions.assert_class('q', x, String)) }.delete_if { |k, v| v.nil? } r = @client.request("/reference/countries").with_query(query).get r.map { |x| ::Io::Flow::V0::Models::Country.new(x) } end |