Class: YahooWeather::Astronomy

Inherits:
Object
  • Object
show all
Defined in:
lib/yahoo_weather/astronomy.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#sunriseObject (readonly)

Returns the value of attribute sunrise.



2
3
4
# File 'lib/yahoo_weather/astronomy.rb', line 2

def sunrise
  @sunrise
end

#sunsetObject (readonly)

Returns the value of attribute sunset.



2
3
4
# File 'lib/yahoo_weather/astronomy.rb', line 2

def sunset
  @sunset
end