Class: GoogleTZAPI::Query

Inherits:
Object
  • Object
show all
Defined in:
lib/google_tz/query.rb

Instance Method Summary collapse

Constructor Details

#initialize(lat, lng, opts) ⇒ Query

Returns a new instance of Query.



7
8
9
10
11
12
13
# File 'lib/google_tz/query.rb', line 7

def initialize(lat, lng, opts)
  @lat = lat
  @lng = lng
  @timestamp = opts[:timestamp] || Time.now.to_i
  @sensor = opts[:sensor] || false
  @language = opts[:language] || "en"
end

Instance Method Details

#lookupObject



15
16
17
18
# File 'lib/google_tz/query.rb', line 15

def lookup
  response = make_request(build_uri)
  Response.new(response.body)
end