Class: YahooWeather::Astronomy

Inherits:
Object
  • Object
show all
Defined in:
lib/yahoo-weather/astronomy.rb

Overview

Describes astronomy information for a particular location.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#sunriseObject (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

#sunsetObject (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