Class: YahooWeather::Astronomy
- Inherits:
-
Object
- Object
- YahooWeather::Astronomy
- Defined in:
- lib/yahoo_weather/astronomy.rb
Instance Attribute Summary collapse
-
#sunrise ⇒ Object
readonly
Returns the value of attribute sunrise.
-
#sunset ⇒ Object
readonly
Returns the value of attribute sunset.
Instance Method Summary collapse
-
#initialize(payload) ⇒ Astronomy
constructor
A new instance of Astronomy.
Constructor Details
#initialize(payload) ⇒ Astronomy
Returns a new instance of Astronomy.
4 5 6 7 |
# File 'lib/yahoo_weather/astronomy.rb', line 4 def initialize(payload) @sunrise = Time.parse(payload['sunrise']) @sunset = Time.parse(payload['sunset']) end |
Instance Attribute Details
#sunrise ⇒ Object (readonly)
Returns the value of attribute sunrise.
2 3 4 |
# File 'lib/yahoo_weather/astronomy.rb', line 2 def sunrise @sunrise end |
#sunset ⇒ Object (readonly)
Returns the value of attribute sunset.
2 3 4 |
# File 'lib/yahoo_weather/astronomy.rb', line 2 def sunset @sunset end |