Class: Io::Flow::V0::Clients::Currencies
- Inherits:
-
Object
- Object
- Io::Flow::V0::Clients::Currencies
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Method Summary collapse
-
#get(incoming = {}) ⇒ Object
Returns a list of currencies.
-
#initialize(client) ⇒ Currencies
constructor
A new instance of Currencies.
Constructor Details
#initialize(client) ⇒ Currencies
Returns a new instance of Currencies.
5503 5504 5505 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5503 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 currencies.
5508 5509 5510 5511 5512 5513 5514 5515 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5508 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/currencies").with_query(query).get r.map { |x| ::Io::Flow::V0::Models::Currency.new(x) } end |