Class: YahooWeather::Condition
- Inherits:
-
Object
- Object
- YahooWeather::Condition
- Defined in:
- lib/yahoo-weather.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
the Yahoo! Weather condition code, as detailed at developer.yahoo.com/weather.
-
#date ⇒ Object
readonly
the date and time associated with these conditions.
-
#temp ⇒ Object
readonly
the temperature of the location.
-
#text ⇒ Object
readonly
the brief prose text description of the weather conditions of the location.
Instance Method Summary collapse
-
#initialize(payload) ⇒ Condition
constructor
A new instance of Condition.
Constructor Details
#initialize(payload) ⇒ Condition
Returns a new instance of Condition.
133 134 135 136 137 138 |
# File 'lib/yahoo-weather.rb', line 133 def initialize (payload) @code = payload['code'].to_i @date = YahooWeather._parse_time(payload['date']) @temp = payload['temp'].to_i @text = payload['text'] end |
Instance Attribute Details
#code ⇒ Object (readonly)
the Yahoo! Weather condition code, as detailed at developer.yahoo.com/weather.
122 123 124 |
# File 'lib/yahoo-weather.rb', line 122 def code @code end |
#date ⇒ Object (readonly)
the date and time associated with these conditions.
125 126 127 |
# File 'lib/yahoo-weather.rb', line 125 def date @date end |
#temp ⇒ Object (readonly)
the temperature of the location.
128 129 130 |
# File 'lib/yahoo-weather.rb', line 128 def temp @temp end |
#text ⇒ Object (readonly)
the brief prose text description of the weather conditions of the location.
131 132 133 |
# File 'lib/yahoo-weather.rb', line 131 def text @text end |