Class: Barometer::WeatherService::WundergroundV1::Query

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/barometer/weather_services/wunderground_v1/query.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(query) ⇒ Query

Returns a new instance of Query.



13
14
15
16
# File 'lib/barometer/weather_services/wunderground_v1/query.rb', line 13

def initialize(query)
  super
  @converted_query = convert_query
end

Instance Attribute Details

#converted_queryObject (readonly)

Returns the value of attribute converted_query.



7
8
9
# File 'lib/barometer/weather_services/wunderground_v1/query.rb', line 7

def converted_query
  @converted_query
end

Class Method Details

.accepted_formatsObject



9
10
11
# File 'lib/barometer/weather_services/wunderground_v1/query.rb', line 9

def self.accepted_formats
  [:zipcode, :postalcode, :icao, :coordinates, :geocode]
end

Instance Method Details

#to_paramObject



18
19
20
# File 'lib/barometer/weather_services/wunderground_v1/query.rb', line 18

def to_param
  {query: converted_query.q.dup}
end