Class: Barometer::WeatherService::WeatherBug::Response::CurrentWeather
- Inherits:
-
Object
- Object
- Barometer::WeatherService::WeatherBug::Response::CurrentWeather
- Defined in:
- lib/barometer/weather_services/weather_bug/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/weather_bug/response/current_weather.rb', line 9 def initialize(payload, timezone) @payload = payload @timezone = timezone @current = Barometer::Response::Current.new 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/weather_bug/response/current_weather.rb', line 15 def parse current.observed_at = observed_at current.stale_at = stale_at current.humidity = humidity current.condition = condition current.icon = icon current.temperature = temperature current.dew_point = dew_point current.wind_chill = wind_chill current.wind = wind current.pressure = pressure current.sun = WeatherBug::Response::Sun.new(payload, timezone).parse current end |