Class: Barometer::WeatherService::Yahoo
- Inherits:
-
Object
- Object
- Barometer::WeatherService::Yahoo
show all
- Defined in:
- lib/barometer/weather_services/yahoo.rb,
lib/barometer/weather_services/yahoo/api.rb,
lib/barometer/weather_services/yahoo/query.rb,
lib/barometer/weather_services/yahoo/response.rb,
lib/barometer/weather_services/yahoo/response/sun.rb,
lib/barometer/weather_services/yahoo/response/location.rb,
lib/barometer/weather_services/yahoo/response/timezone.rb,
lib/barometer/weather_services/yahoo/response/current_weather.rb,
lib/barometer/weather_services/yahoo/response/forecasted_weather.rb
Defined Under Namespace
Classes: Api, Query, Response
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(query) ⇒ Yahoo
Returns a new instance of Yahoo.
11
12
13
|
# File 'lib/barometer/weather_services/yahoo.rb', line 11
def initialize(query)
@query = query
end
|
Class Method Details
.call(query, config = {}) ⇒ Object
7
8
9
|
# File 'lib/barometer/weather_services/yahoo.rb', line 7
def self.call(query, config={})
Yahoo.new(query).measure!
end
|
Instance Method Details
#measure! ⇒ Object
15
16
17
18
|
# File 'lib/barometer/weather_services/yahoo.rb', line 15
def measure!
api = Yahoo::Api.new(query)
Yahoo::Response.new.parse(api.get)
end
|