Class: LibTAD::Astronomy::AstronomyDayEvent

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

Overview

Information about an astronomical event at a specific day.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ AstronomyDayEvent

Returns a new instance of AstronomyDayEvent.



61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/types/astronomy/astronomy_day_event.rb', line 61

def initialize(hash)
  @type = hash.fetch('type', nil)
  @hour = hash.fetch('hour', nil)
  @min = hash.fetch('min', nil)
  @sec = hash.fetch('sec', nil)
  @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)
end

Instance Attribute Details

#altitudeFloat (readonly)

Altitude of the center of the queried astronomical object above an ideal horizon. Only for meridian type events.

Returns:

  • (Float)

    (degrees)



38
39
40
# File 'lib/types/astronomy/astronomy_day_event.rb', line 38

def altitude
  @altitude
end

#azimuthFloat (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. Only for rise and set type events.

Returns:

  • (Float)

    (degrees)



44
45
46
# File 'lib/types/astronomy/astronomy_day_event.rb', line 44

def azimuth
  @azimuth
end

#distanceFloat (readonly)

Distance of the earth’s center to the center of the queried astronomical object in kilometers. Only for meridian type events.

Returns:

  • (Float)

    (km)



49
50
51
# File 'lib/types/astronomy/astronomy_day_event.rb', line 49

def distance
  @distance
end

#hourInteger (readonly)

Hour at which the event is happening (local time).

Returns:

  • (Integer)


11
12
13
# File 'lib/types/astronomy/astronomy_day_event.rb', line 11

def hour
  @hour
end

#illuminatedFloat (readonly)

The fraction of the Moon’s surface illuminated by the Sun’s rays as seen from the selected location. Only for the moon for meridian type events.

Returns:

  • (Float)

    (percent)



54
55
56
# File 'lib/types/astronomy/astronomy_day_event.rb', line 54

def illuminated
  @illuminated
end

#isotimeString (readonly)

Local time at which the event is happening in ISO 8601 format (including UTC offset). Only returned if requested by specifying the parameter isotime.

Example: 2012-04-17T00:57:42+02:00

Returns:

  • (String)


26
27
28
# File 'lib/types/astronomy/astronomy_day_event.rb', line 26

def isotime
  @isotime
end

#minuteInteger (readonly)

Minute at which the event is happening (local time).

Returns:

  • (Integer)


15
16
17
# File 'lib/types/astronomy/astronomy_day_event.rb', line 15

def minute
  @minute
end

#posangleFloat (readonly)

The counterclockwise angle of the midpoint of the Moon’s bright limb as seen from the selected location. Only for the moon for meridian type events.

Returns:

  • (Float)

    (degrees)



59
60
61
# File 'lib/types/astronomy/astronomy_day_event.rb', line 59

def posangle
  @posangle
end

#secondInteger (readonly)

Second at which the event is happening (local time).

Returns:

  • (Integer)


19
20
21
# File 'lib/types/astronomy/astronomy_day_event.rb', line 19

def second
  @second
end

#typeString (readonly)

Indicates the type of the event.

Returns:

  • (String)


7
8
9
# File 'lib/types/astronomy/astronomy_day_event.rb', line 7

def type
  @type
end

#utctimeString (readonly)

UTC time at which the event is happening in ISO 8601 format. Only returned if requested by specifying the parameter utctime.

Example: 2012-04-16T22:57:42

Returns:

  • (String)


33
34
35
# File 'lib/types/astronomy/astronomy_day_event.rb', line 33

def utctime
  @utctime
end