Class: YahooWeather::Astronomy
- Inherits:
-
Object
- Object
- YahooWeather::Astronomy
- Defined in:
- lib/yahoo-weather/astronomy.rb
Overview
Describes astronomy information for a particular location.
Instance Attribute Summary collapse
-
#sunrise ⇒ Object
readonly
a Time object detailing the sunrise time for a location.
-
#sunset ⇒ Object
readonly
a Time object detailing the sunset time for a location.
Instance Method Summary collapse
-
#initialize(payload) ⇒ Astronomy
constructor
A new instance of Astronomy.
Constructor Details
#initialize(payload) ⇒ Astronomy
Returns a new instance of Astronomy.
9 10 11 12 |
# File 'lib/yahoo-weather/astronomy.rb', line 9 def initialize (payload) @sunrise = YahooWeather._parse_time(payload['sunrise']) @sunset = YahooWeather._parse_time(payload['sunset']) end |
Instance Attribute Details
#sunrise ⇒ Object (readonly)
a Time object detailing the sunrise time for a location.
4 5 6 |
# File 'lib/yahoo-weather/astronomy.rb', line 4 def sunrise @sunrise end |
#sunset ⇒ Object (readonly)
a Time object detailing the sunset time for a location.
7 8 9 |
# File 'lib/yahoo-weather/astronomy.rb', line 7 def sunset @sunset end |