class LibTAD::Astronomy::AstronomyCurrent

Current information about an astronomy object.

Attributes

altitude[R]

@return [Float] Altitude of the center of the queried astronomical object above an ideal horizon.

azimuth[R]

@return [Float] (degrees) 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.

distance[R]

@return [Float] (km) Distance of the earth's center to the center of the queried astronomical object in kilometers.

illuminated[R]

@return [Float] (percent) 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.

isotime[R]

@return [String] 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

moonphase[R]

@return [MoonPhase] The current phase of the moon. Only available for the moon object.

posangle[R]

@return [Float] (degrees) The counterclockwise angle of the midpoint of the Moon's bright limb as seen from the selected location. Only available for the moon object.

utctime[R]

@return [String] 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

Public Class Methods

new(hash) click to toggle source
# 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