class Io::Flow::V0::Clients::Currencies

Public Class Methods

new(client) click to toggle source
# 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

Public Instance Methods

get(incoming={}) click to toggle source

Returns a list of currencies.

# 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