Class: Barometer::WeatherService::Yahoo
- Inherits:
-
Object
- Object
- Barometer::WeatherService::Yahoo
- Defined in:
- lib/barometer/weather_services/yahoo.rb
Class Method Summary (collapse)
Instance Method Summary (collapse)
-
- (Yahoo) initialize(query, config = {})
constructor
A new instance of Yahoo.
- - (Object) measure!
Constructor Details
- (Yahoo) initialize(query, config = {})
A new instance of Yahoo
16 17 18 19 20 |
# File 'lib/barometer/weather_services/yahoo.rb', line 16 def initialize(query, config={}) @query = query @metric = config.fetch(:metric, true) @response = Response.new(metric) end |
Class Method Details
+ (Object) accepted_formats
8 9 10 |
# File 'lib/barometer/weather_services/yahoo.rb', line 8 def self.accepted_formats [:zipcode, :weather_id, :woe_id] end |
+ (Object) call(query, config = {})
12 13 14 |
# File 'lib/barometer/weather_services/yahoo.rb', line 12 def self.call(query, config={}) WeatherService::Yahoo.new(query, config).measure! end |
Instance Method Details
- (Object) measure!
22 23 24 25 26 27 28 29 |
# File 'lib/barometer/weather_services/yahoo.rb', line 22 def measure! convert_query! @requester = Barometer::Requester::Yahoo.new(metric) fetch_and_parse_weather response end |