Class: LibTAD::Astronomy::AstronomyCurrent
- Inherits:
-
Object
- Object
- LibTAD::Astronomy::AstronomyCurrent
- Defined in:
- lib/types/astronomy/astronomy_current.rb
Overview
Current information about an astronomy object.
Instance Attribute Summary collapse
-
#altitude ⇒ Float
readonly
Altitude of the center of the queried astronomical object above an ideal horizon.
-
#azimuth ⇒ Float
readonly
Horizontal direction of the astronomical object at set/rise time (referring to true north).
-
#distance ⇒ Float
readonly
Distance of the earth’s center to the center of the queried astronomical object in kilometers.
-
#illuminated ⇒ Float
readonly
The fraction of the Moon’s surface illuminated by the Sun’s rays as seen from the selected location.
-
#isotime ⇒ String
readonly
Local time stamp for the data in ISO 8601 format (including UTC offset).
-
#moonphase ⇒ MoonPhase
readonly
The current phase of the moon.
-
#posangle ⇒ Float
readonly
The counterclockwise angle of the midpoint of the Moon’s bright limb as seen from the selected location.
-
#utctime ⇒ String
readonly
UTC time stamp for the data in ISO 8601 format.
Instance Method Summary collapse
-
#initialize(hash) ⇒ AstronomyCurrent
constructor
A new instance of AstronomyCurrent.
Constructor Details
#initialize(hash) ⇒ AstronomyCurrent
Returns a new instance of AstronomyCurrent.
46 47 48 49 50 51 52 53 54 55 |
# File 'lib/types/astronomy/astronomy_current.rb', line 46 def initialize(hash) @isotime = hash.fetch('isotime', nil) @utctime = hash.fetch('utctime', nil) @altitude = hash.fetch('altitude', nil) @azimuth = hash.fetch('azimuth', nil) @distance = hash.fetch('distance', nil) @illuminated = hash.fetch('illuminated', nil) @posangle = hash.fetch('posangle', nil) @moonphase = MoonPhase.new hash['moonphase'] unless !hash.key?('moonphase') end |
Instance Attribute Details
#altitude ⇒ Float (readonly)
Altitude of the center of the queried astronomical object above an ideal horizon.
21 22 23 |
# File 'lib/types/astronomy/astronomy_current.rb', line 21 def altitude @altitude end |
#azimuth ⇒ Float (readonly)
Horizontal direction of the astronomical object at set/rise time (referring to true north). North is 0 degrees, east is 90 degrees, south is 180 degrees and west is 270 degrees.
26 27 28 |
# File 'lib/types/astronomy/astronomy_current.rb', line 26 def azimuth @azimuth end |
#distance ⇒ Float (readonly)
Distance of the earth’s center to the center of the queried astronomical object in kilometers.
30 31 32 |
# File 'lib/types/astronomy/astronomy_current.rb', line 30 def distance @distance end |
#illuminated ⇒ Float (readonly)
The fraction of the Moon’s surface illuminated by the Sun’s rays as seen from the selected location. Only available for the moon object.
35 36 37 |
# File 'lib/types/astronomy/astronomy_current.rb', line 35 def illuminated @illuminated end |
#isotime ⇒ String (readonly)
Local time stamp for the data in ISO 8601 format (including UTC offset). Only returned if requested by specifying the parameter isotime.
Example: 2012-04-17T00:57:42+02:00
10 11 12 |
# File 'lib/types/astronomy/astronomy_current.rb', line 10 def isotime @isotime end |
#moonphase ⇒ MoonPhase (readonly)
The current phase of the moon. Only available for the moon object.
44 45 46 |
# File 'lib/types/astronomy/astronomy_current.rb', line 44 def moonphase @moonphase end |
#posangle ⇒ Float (readonly)
The counterclockwise angle of the midpoint of the Moon’s bright limb as seen from the selected location. Only available for the moon object.
40 41 42 |
# File 'lib/types/astronomy/astronomy_current.rb', line 40 def posangle @posangle end |
#utctime ⇒ String (readonly)
UTC time stamp for the data in ISO 8601 format. Only returned if requested by specifying the parameter utctime.
Example: 2012-04-16T22:57:42
17 18 19 |
# File 'lib/types/astronomy/astronomy_current.rb', line 17 def utctime @utctime end |