class Io::Flow::Reference::V0::Clients::Locales
Public Class Methods
new(client)
click to toggle source
# File lib/flow_reference_v0_client.rb, line 159 def initialize(client) @client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::Reference::V0::Client) end
Public Instance Methods
get(incoming={})
click to toggle source
Returns a list of locales.
# File lib/flow_reference_v0_client.rb, line 164 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/locales").with_query(query).get r.map { |x| ::Io::Flow::Reference::V0::Models::Locale.new(x) } end
get_by_id(id)
click to toggle source
Returns the locale with the specifed id.
# File lib/flow_reference_v0_client.rb, line 174 def get_by_id(id) HttpClient::Preconditions.assert_class('id', id, String) r = @client.request("/reference/locales/#{CGI.escape(id)}").get ::Io::Flow::Reference::V0::Models::Locale.new(r) end