Class: UndergroundWeather::CurrentConditions
- Inherits:
-
Object
- Object
- UndergroundWeather::CurrentConditions
- Defined in:
- lib/undergroundweather/features/current_conditions.rb
Instance Attribute Summary collapse
-
#city ⇒ Object
readonly
Returns the value of attribute city.
-
#country ⇒ Object
readonly
Returns the value of attribute country.
-
#dewpoint_c ⇒ Object
readonly
Returns the value of attribute dewpoint_c.
-
#dewpoint_f ⇒ Object
readonly
Returns the value of attribute dewpoint_f.
-
#elevation ⇒ Object
readonly
Returns the value of attribute elevation.
-
#heat_index_c ⇒ Object
readonly
Returns the value of attribute heat_index_c.
-
#heat_index_f ⇒ Object
readonly
Returns the value of attribute heat_index_f.
-
#humidity ⇒ Object
readonly
Returns the value of attribute humidity.
-
#icon ⇒ Object
readonly
Returns the value of attribute icon.
-
#latitude ⇒ Object
readonly
Returns the value of attribute latitude.
-
#longitude ⇒ Object
readonly
Returns the value of attribute longitude.
-
#precip_hour ⇒ Object
readonly
Returns the value of attribute precip_hour.
-
#precip_today ⇒ Object
readonly
Returns the value of attribute precip_today.
-
#pressure_in ⇒ Object
readonly
Returns the value of attribute pressure_in.
-
#pressure_mb ⇒ Object
readonly
Returns the value of attribute pressure_mb.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
-
#station ⇒ Object
readonly
Returns the value of attribute station.
-
#temp_c ⇒ Object
readonly
Returns the value of attribute temp_c.
-
#temp_f ⇒ Object
readonly
Returns the value of attribute temp_f.
-
#time ⇒ Object
readonly
Returns the value of attribute time.
-
#time_zone ⇒ Object
readonly
Returns the value of attribute time_zone.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
-
#visibility_km ⇒ Object
readonly
Returns the value of attribute visibility_km.
-
#visibility_mi ⇒ Object
readonly
Returns the value of attribute visibility_mi.
-
#weather ⇒ Object
readonly
Returns the value of attribute weather.
-
#wind ⇒ Object
readonly
Returns the value of attribute wind.
-
#wind_dir ⇒ Object
readonly
Returns the value of attribute wind_dir.
-
#wind_mph ⇒ Object
readonly
Returns the value of attribute wind_mph.
-
#windchill_c ⇒ Object
readonly
Returns the value of attribute windchill_c.
-
#windchill_f ⇒ Object
readonly
Returns the value of attribute windchill_f.
-
#zip ⇒ Object
readonly
Returns the value of attribute zip.
Instance Method Summary collapse
- #dewpoint ⇒ Object
- #heat_index ⇒ Object
-
#initialize(feed) ⇒ CurrentConditions
constructor
A new instance of CurrentConditions.
- #temp ⇒ Object
- #visibility ⇒ Object
- #windchill ⇒ Object
Constructor Details
#initialize(feed) ⇒ CurrentConditions
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/undergroundweather/features/current_conditions.rb', line 11 def initialize(feed) obsv = feed['current_observation'] @city = obsv['display_location']['city'] @state = obsv['display_location']['state'] @country = obsv['display_location']['country'] @zip = obsv['display_location']['zip'] @longitude = obsv['display_location']['longitude'] @latitude = obsv['display_location']['latitude'] @elevation = obsv['display_location']['elevation'] @time_zone = obsv['local_tz_short'] @time = obsv['observation_time_rfc822'] @station = obsv['station_id'] @weather = obsv['weather'] @temp_f = obsv['temp_f'] @temp_c = obsv['temp_c'] @humidity = obsv['relative_humidity'] @wind = obsv['wind_string'] @wind_dir = obsv['wind_dir'] @wind_mph = obsv['wind_mph'] @heat_index_f = obsv['heat_index_f'] @heat_index_c = obsv['heat_index_c'] @windchill_f = obsv['windchill_f'] @windchill_c = obsv['windchill_c'] @dewpoint_f = obsv['dewpoint_f'] @dewpoint_c = obsv['dewpoint_c'] @visibility_mi = obsv['visibility_mi'] @visibility_km = obsv['visibility_km'] @pressure_mb = obsv['pressure_mb'] @pressure_in = obsv['pressure_in'] @precip_today = obsv['precip_today_in'] @precip_hour = obsv['precip_1hr_in'] @icon = obsv['icon_url'] @url = obsv['forecast_url'] end |
Instance Attribute Details
#city ⇒ Object (readonly)
Returns the value of attribute city.
3 4 5 |
# File 'lib/undergroundweather/features/current_conditions.rb', line 3 def city @city end |
#country ⇒ Object (readonly)
Returns the value of attribute country.
3 4 5 |
# File 'lib/undergroundweather/features/current_conditions.rb', line 3 def country @country end |
#dewpoint_c ⇒ Object (readonly)
Returns the value of attribute dewpoint_c.
3 4 5 |
# File 'lib/undergroundweather/features/current_conditions.rb', line 3 def dewpoint_c @dewpoint_c end |
#dewpoint_f ⇒ Object (readonly)
Returns the value of attribute dewpoint_f.
3 4 5 |
# File 'lib/undergroundweather/features/current_conditions.rb', line 3 def dewpoint_f @dewpoint_f end |
#elevation ⇒ Object (readonly)
Returns the value of attribute elevation.
3 4 5 |
# File 'lib/undergroundweather/features/current_conditions.rb', line 3 def elevation @elevation end |
#heat_index_c ⇒ Object (readonly)
Returns the value of attribute heat_index_c.
3 4 5 |
# File 'lib/undergroundweather/features/current_conditions.rb', line 3 def heat_index_c @heat_index_c end |
#heat_index_f ⇒ Object (readonly)
Returns the value of attribute heat_index_f.
3 4 5 |
# File 'lib/undergroundweather/features/current_conditions.rb', line 3 def heat_index_f @heat_index_f end |
#humidity ⇒ Object (readonly)
Returns the value of attribute humidity.
3 4 5 |
# File 'lib/undergroundweather/features/current_conditions.rb', line 3 def humidity @humidity end |
#icon ⇒ Object (readonly)
Returns the value of attribute icon.
3 4 5 |
# File 'lib/undergroundweather/features/current_conditions.rb', line 3 def icon @icon end |
#latitude ⇒ Object (readonly)
Returns the value of attribute latitude.
3 4 5 |
# File 'lib/undergroundweather/features/current_conditions.rb', line 3 def latitude @latitude end |
#longitude ⇒ Object (readonly)
Returns the value of attribute longitude.
3 4 5 |
# File 'lib/undergroundweather/features/current_conditions.rb', line 3 def longitude @longitude end |
#precip_hour ⇒ Object (readonly)
Returns the value of attribute precip_hour.
3 4 5 |
# File 'lib/undergroundweather/features/current_conditions.rb', line 3 def precip_hour @precip_hour end |
#precip_today ⇒ Object (readonly)
Returns the value of attribute precip_today.
3 4 5 |
# File 'lib/undergroundweather/features/current_conditions.rb', line 3 def precip_today @precip_today end |
#pressure_in ⇒ Object (readonly)
Returns the value of attribute pressure_in.
3 4 5 |
# File 'lib/undergroundweather/features/current_conditions.rb', line 3 def pressure_in @pressure_in end |
#pressure_mb ⇒ Object (readonly)
Returns the value of attribute pressure_mb.
3 4 5 |
# File 'lib/undergroundweather/features/current_conditions.rb', line 3 def pressure_mb @pressure_mb end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
3 4 5 |
# File 'lib/undergroundweather/features/current_conditions.rb', line 3 def state @state end |
#station ⇒ Object (readonly)
Returns the value of attribute station.
3 4 5 |
# File 'lib/undergroundweather/features/current_conditions.rb', line 3 def station @station end |
#temp_c ⇒ Object (readonly)
Returns the value of attribute temp_c.
3 4 5 |
# File 'lib/undergroundweather/features/current_conditions.rb', line 3 def temp_c @temp_c end |
#temp_f ⇒ Object (readonly)
Returns the value of attribute temp_f.
3 4 5 |
# File 'lib/undergroundweather/features/current_conditions.rb', line 3 def temp_f @temp_f end |
#time ⇒ Object (readonly)
Returns the value of attribute time.
3 4 5 |
# File 'lib/undergroundweather/features/current_conditions.rb', line 3 def time @time end |
#time_zone ⇒ Object (readonly)
Returns the value of attribute time_zone.
3 4 5 |
# File 'lib/undergroundweather/features/current_conditions.rb', line 3 def time_zone @time_zone end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
3 4 5 |
# File 'lib/undergroundweather/features/current_conditions.rb', line 3 def url @url end |
#visibility_km ⇒ Object (readonly)
Returns the value of attribute visibility_km.
3 4 5 |
# File 'lib/undergroundweather/features/current_conditions.rb', line 3 def visibility_km @visibility_km end |
#visibility_mi ⇒ Object (readonly)
Returns the value of attribute visibility_mi.
3 4 5 |
# File 'lib/undergroundweather/features/current_conditions.rb', line 3 def visibility_mi @visibility_mi end |
#weather ⇒ Object (readonly)
Returns the value of attribute weather.
3 4 5 |
# File 'lib/undergroundweather/features/current_conditions.rb', line 3 def weather @weather end |
#wind ⇒ Object (readonly)
Returns the value of attribute wind.
3 4 5 |
# File 'lib/undergroundweather/features/current_conditions.rb', line 3 def wind @wind end |
#wind_dir ⇒ Object (readonly)
Returns the value of attribute wind_dir.
3 4 5 |
# File 'lib/undergroundweather/features/current_conditions.rb', line 3 def wind_dir @wind_dir end |
#wind_mph ⇒ Object (readonly)
Returns the value of attribute wind_mph.
3 4 5 |
# File 'lib/undergroundweather/features/current_conditions.rb', line 3 def wind_mph @wind_mph end |
#windchill_c ⇒ Object (readonly)
Returns the value of attribute windchill_c.
3 4 5 |
# File 'lib/undergroundweather/features/current_conditions.rb', line 3 def windchill_c @windchill_c end |
#windchill_f ⇒ Object (readonly)
Returns the value of attribute windchill_f.
3 4 5 |
# File 'lib/undergroundweather/features/current_conditions.rb', line 3 def windchill_f @windchill_f end |
#zip ⇒ Object (readonly)
Returns the value of attribute zip.
3 4 5 |
# File 'lib/undergroundweather/features/current_conditions.rb', line 3 def zip @zip end |
Instance Method Details
#dewpoint ⇒ Object
66 67 68 |
# File 'lib/undergroundweather/features/current_conditions.rb', line 66 def dewpoint @dewpoint_f end |
#heat_index ⇒ Object
54 55 56 |
# File 'lib/undergroundweather/features/current_conditions.rb', line 54 def heat_index @head_index_f end |
#temp ⇒ Object
50 51 52 |
# File 'lib/undergroundweather/features/current_conditions.rb', line 50 def temp @temp_f end |
#visibility ⇒ Object
62 63 64 |
# File 'lib/undergroundweather/features/current_conditions.rb', line 62 def visibility @visibility_mi end |
#windchill ⇒ Object
58 59 60 |
# File 'lib/undergroundweather/features/current_conditions.rb', line 58 def windchill @windchill_f end |