class LibTAD::Astronomy::AstronomyDay

Information about an astronomy object for a specific day.

Attributes

date[R]

@return [String] Date for the current information.

daylength[R]

@return [String] Length of this day (time between sunrise and sunset). If the sun is not up on this day, 00:00:00 will reported. If the sun does not set on this day, the value will read 24:00:00. Attribute only applies for the sun object and if requested.

events[R]

@return [Array<AstronomyDayEvent>] Lists all events during the day.

moonphase[R]

@return [String] Moon phase for the day. Only if requested.

Public Class Methods

new(hash) click to toggle source
# File lib/types/astronomy/astronomy_day.rb, line 23
def initialize(hash)
  @date = hash.fetch('date', nil)
  @daylength = hash.fetch('daylength', nil)
  @moonphase = hash.fetch('moonphase', nil)
  @events = hash.fetch('events', nil)
    &.map { |e| AstronomyDayEvent.new(e) }
end