Class: Io::Flow::V0::Clients::Languages
- Inherits:
-
Object
- Object
- Io::Flow::V0::Clients::Languages
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Method Summary collapse
-
#get(incoming = {}) ⇒ Object
Returns a list of languages.
-
#initialize(client) ⇒ Languages
constructor
A new instance of Languages.
Constructor Details
#initialize(client) ⇒ Languages
Returns a new instance of Languages.
5521 5522 5523 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5521 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 languages.
5526 5527 5528 5529 5530 5531 5532 5533 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5526 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/languages").with_query(query).get r.map { |x| ::Io::Flow::V0::Models::Language.new(x) } end |