Class: Io::Flow::V0::Clients::AddressConfigurations
- Inherits:
-
Object
- Object
- Io::Flow::V0::Clients::AddressConfigurations
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Method Summary collapse
-
#get(organization, incoming = {}) ⇒ Object
Search checkout address configurations.
-
#initialize(client) ⇒ AddressConfigurations
constructor
A new instance of AddressConfigurations.
Constructor Details
#initialize(client) ⇒ AddressConfigurations
Returns a new instance of AddressConfigurations.
592 593 594 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 592 def initialize(client) @client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client) end |
Instance Method Details
#get(organization, incoming = {}) ⇒ Object
Search checkout address configurations.
597 598 599 600 601 602 603 604 605 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 597 def get(organization, incoming={}) HttpClient::Preconditions.assert_class('organization', organization, String) opts = HttpClient::Helper.symbolize_keys(incoming) query = { :country => (x = opts.delete(:country); x.nil? ? nil : HttpClient::Preconditions.assert_class('country', x, Array).map { |v| HttpClient::Preconditions.assert_class('country', v, String) }) }.delete_if { |k, v| v.nil? } r = @client.request("/#{CGI.escape(organization)}/address/configurations").with_query(query).get r.map { |x| ::Io::Flow::V0::Models::AddressConfiguration.new(x) } end |