Class: Yweather::Forecast
- Inherits:
-
Object
- Object
- Yweather::Forecast
- Includes:
- Utils
- Defined in:
- lib/yweather/forecast.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#date ⇒ Object
readonly
Returns the value of attribute date.
-
#day ⇒ Object
readonly
Returns the value of attribute day.
-
#high ⇒ Object
readonly
Returns the value of attribute high.
-
#low ⇒ Object
readonly
Returns the value of attribute low.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Instance Method Summary collapse
-
#initialize(data) ⇒ Forecast
constructor
A new instance of Forecast.
Methods included from Utils
Constructor Details
#initialize(data) ⇒ Forecast
Returns a new instance of Forecast.
12 13 14 15 16 17 18 19 |
# File 'lib/yweather/forecast.rb', line 12 def initialize (data) @day = data[:day] @date = parse_time(data[:date]) @low = data[:low].to_i @high = data[:high].to_i @text = data[:text] @code = data[:code].to_i end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
10 11 12 |
# File 'lib/yweather/forecast.rb', line 10 def code @code end |
#date ⇒ Object (readonly)
Returns the value of attribute date.
6 7 8 |
# File 'lib/yweather/forecast.rb', line 6 def date @date end |
#day ⇒ Object (readonly)
Returns the value of attribute day.
5 6 7 |
# File 'lib/yweather/forecast.rb', line 5 def day @day end |
#high ⇒ Object (readonly)
Returns the value of attribute high.
8 9 10 |
# File 'lib/yweather/forecast.rb', line 8 def high @high end |
#low ⇒ Object (readonly)
Returns the value of attribute low.
7 8 9 |
# File 'lib/yweather/forecast.rb', line 7 def low @low end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
9 10 11 |
# File 'lib/yweather/forecast.rb', line 9 def text @text end |