Class: EarthTools::Sun

Inherits:
Object
  • Object
show all
Defined in:
lib/earth_tools/sun.rb,
lib/earth_tools/sun/evening.rb,
lib/earth_tools/sun/morning.rb,
lib/earth_tools/sun/twilight.rb

Defined Under Namespace

Classes: Evening, Morning, Twilight

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attrs = {}) ⇒ Sun

Returns a new instance of Sun.



5
6
7
8
9
10
11
12
# File 'lib/earth_tools/sun.rb', line 5

def initialize(attrs = {})
  attrs ||= {}
  @version = attrs['version']
  @location = EarthTools::Location.new(attrs['location'])
  @date = EarthTools::Date.new(attrs['date'])
  @morning = EarthTools::Sun::Morning.new(attrs['morning'])
  @evening = EarthTools::Sun::Evening.new(attrs['evening'])
end

Instance Attribute Details

#dateObject

Returns the value of attribute date.



3
4
5
# File 'lib/earth_tools/sun.rb', line 3

def date
  @date
end

#eveningObject

Returns the value of attribute evening.



3
4
5
# File 'lib/earth_tools/sun.rb', line 3

def evening
  @evening
end

#locationObject

Returns the value of attribute location.



3
4
5
# File 'lib/earth_tools/sun.rb', line 3

def location
  @location
end

#morningObject

Returns the value of attribute morning.



3
4
5
# File 'lib/earth_tools/sun.rb', line 3

def morning
  @morning
end

#versionObject

Returns the value of attribute version.



3
4
5
# File 'lib/earth_tools/sun.rb', line 3

def version
  @version
end