Class: Barometer::Query::Service::GoogleGeocode

Inherits:
Object
  • Object
show all
Defined in:
lib/barometer/query/services/google_geocode.rb,
lib/barometer/query/services/apis/google_geocode.rb

Defined Under Namespace

Classes: Api

Instance Method Summary collapse

Constructor Details

#initialize(query) ⇒ GoogleGeocode

Returns a new instance of GoogleGeocode.



7
8
9
# File 'lib/barometer/query/services/google_geocode.rb', line 7

def initialize(query)
  @query = query
end

Instance Method Details

#callObject



11
12
13
14
15
16
17
# File 'lib/barometer/query/services/google_geocode.rb', line 11

def call
  converted_query = query.get_conversion(:short_zipcode, :zipcode, :postalcode, :coordinates, :icao, :unknown)
  return unless converted_query

  @payload = GoogleGeocode::Api.new(converted_query).get
  parse_payload
end