Class: Barometer::Noaa::Response::CurrentWeather
- Inherits:
-
Object
- Object
- Barometer::Noaa::Response::CurrentWeather
- Defined in:
- lib/barometer/noaa/response/current_weather.rb
Instance Method Summary collapse
-
#initialize(payload) ⇒ CurrentWeather
constructor
A new instance of CurrentWeather.
- #parse ⇒ Object
Constructor Details
#initialize(payload) ⇒ CurrentWeather
Returns a new instance of CurrentWeather.
5 6 7 8 |
# File 'lib/barometer/noaa/response/current_weather.rb', line 5 def initialize(payload) @payload = payload @current = Barometer::Response::Current.new end |
Instance Method Details
#parse ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/barometer/noaa/response/current_weather.rb', line 10 def parse current.observed_at = observed_at, '%a, %d %b %Y %H:%M:%S %z' 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.visibility = visibility current end |