Class: Weather::Astronomy
- Inherits:
-
Object
- Object
- Weather::Astronomy
- Defined in:
- lib/weather-api/astronomy.rb
Instance Attribute Summary collapse
-
#sunrise ⇒ Object
readonly
a Time object containing the sunrise time for a location.
-
#sunset ⇒ Object
readonly
a Time object containing 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/weather-api/astronomy.rb', line 9 def initialize(payload) @sunrise = Utils.parse_time payload[:sunrise] @sunset = Utils.parse_time payload[:sunset] end |
Instance Attribute Details
#sunrise ⇒ Object (readonly)
a Time object containing the sunrise time for a location
4 5 6 |
# File 'lib/weather-api/astronomy.rb', line 4 def sunrise @sunrise end |
#sunset ⇒ Object (readonly)
a Time object containing the sunset time for a location
7 8 9 |
# File 'lib/weather-api/astronomy.rb', line 7 def sunset @sunset end |