class Io::Flow::V0::Clients::Timezones
Public Class Methods
new(client)
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 5421 def initialize(client) @client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client) end
Public Instance Methods
get_geolocation_and_timezones(incoming={})
click to toggle source
Provides timezone based on address or geolocated IP.
# File lib/flow_commerce/flow_api_v0_client.rb, line 5426 def get_geolocation_and_timezones(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) query = { :ip => (x = opts.delete(:ip); x.nil? ? nil : HttpClient::Preconditions.assert_class('ip', x, String)) }.delete_if { |k, v| v.nil? } r = @client.request("/geolocation/timezones").with_query(query).get r.map { |x| ::Io::Flow::V0::Models::Timezone.new(x) } end
get_reference_and_timezones(incoming={})
click to toggle source
Returns
a list of timezones.
# File lib/flow_commerce/flow_api_v0_client.rb, line 5436 def get_reference_and_timezones(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/timezones").with_query(query).get r.map { |x| ::Io::Flow::V0::Models::Timezone.new(x) } end