Class: Barometer::WeatherService::Yahoo::Response::CurrentWeather
- Inherits:
-
Object
- Object
- Barometer::WeatherService::Yahoo::Response::CurrentWeather
- Defined in:
- lib/barometer/weather_services/yahoo/response/current_weather.rb
Instance Method Summary collapse
-
#initialize(payload, timezone) ⇒ CurrentWeather
constructor
A new instance of CurrentWeather.
- #parse ⇒ Object
Constructor Details
#initialize(payload, timezone) ⇒ CurrentWeather
Returns a new instance of CurrentWeather.
9 10 11 12 13 |
# File 'lib/barometer/weather_services/yahoo/response/current_weather.rb', line 9 def initialize(payload, timezone) @payload = payload @timezone = timezone @current = Barometer::Response::Current.new # needs query or metric end |
Instance Method Details
#parse ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/barometer/weather_services/yahoo/response/current_weather.rb', line 15 def parse current.observed_at = observed_at, '%a, %d %b %Y %l:%M %P %Z' current.stale_at = stale_at current.condition = condition current.icon = icon current.temperature = temperature current.humidity = humidity current.pressure = pressure current.visibility = visibility current.wind_chill = wind_chill current.wind = wind current.sun = Yahoo::Response::Sun.new(payload, base_time).parse current end |