Class: GmapsTz::Client
- Inherits:
-
Object
- Object
- GmapsTz::Client
- Includes:
- TimeZone
- Defined in:
- lib/gmaps_tz/client.rb,
lib/gmaps_tz/client/time_zone.rb
Defined Under Namespace
Modules: TimeZone
Constant Summary collapse
- FORMAT =
"/json"- HOST =
"maps.googleapis.com"- BASE_PATH =
"/maps/api"
Instance Attribute Summary collapse
-
#key ⇒ Object
Returns the value of attribute key.
Instance Method Summary collapse
- #get(path, query_params) ⇒ Object
-
#initialize(options = {}) ⇒ Client
constructor
A new instance of Client.
Methods included from TimeZone
Constructor Details
#initialize(options = {}) ⇒ Client
Returns a new instance of Client.
14 15 16 17 18 |
# File 'lib/gmaps_tz/client.rb', line 14 def initialize( = {}) @key = [:key] @basic_params = { sensor: false } @basic_params[:key] = [:key] if [:key] end |
Instance Attribute Details
#key ⇒ Object
Returns the value of attribute key.
12 13 14 |
# File 'lib/gmaps_tz/client.rb', line 12 def key @key end |
Instance Method Details
#get(path, query_params) ⇒ Object
20 21 22 23 24 |
# File 'lib/gmaps_tz/client.rb', line 20 def get(path, query_params) uri = generate_uri(path, query_params) response = Net::HTTP.get_response(uri) ResponseParser.new(uri, response).execute end |