Class: Io::Flow::V0::Clients::CountryPickers
- Inherits:
-
Object
- Object
- Io::Flow::V0::Clients::CountryPickers
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Method Summary collapse
- #get(organization_id) ⇒ Object
-
#initialize(client) ⇒ CountryPickers
constructor
A new instance of CountryPickers.
- #put(organization_id, country_picker_form) ⇒ Object
Constructor Details
#initialize(client) ⇒ CountryPickers
Returns a new instance of CountryPickers.
6322 6323 6324 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6322 def initialize(client) @client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client) end |
Instance Method Details
#get(organization_id) ⇒ Object
6326 6327 6328 6329 6330 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6326 def get(organization_id) HttpClient::Preconditions.assert_class('organization_id', organization_id, String) r = @client.request("/organizations/#{CGI.escape(organization_id)}/country/picker").get ::Io::Flow::V0::Models::CountryPicker.new(r) end |
#put(organization_id, country_picker_form) ⇒ Object
6332 6333 6334 6335 6336 6337 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6332 def put(organization_id, country_picker_form) HttpClient::Preconditions.assert_class('organization_id', organization_id, String) (x = country_picker_form; x.is_a?(::Io::Flow::V0::Models::CountryPickerForm) ? x : ::Io::Flow::V0::Models::CountryPickerForm.new(x)) r = @client.request("/organizations/#{CGI.escape(organization_id)}/country/picker").with_json(country_picker_form.to_json).put ::Io::Flow::V0::Models::CountryPicker.new(r) end |