Class: LibTAD::Astronomy::AstronomyEvent

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

Overview

Information about a sunrise/sunset event for a specific day.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ AstronomyEvent

Returns a new instance of AstronomyEvent.



17
18
19
20
21
# File 'lib/types/astronomy/astronomy_event.rb', line 17

def initialize(hash)
  @type = hash.fetch('type', nil)
  @hour = hash.fetch('hour', nil)
  @minute = hash.fetch('minute', nil)
end

Instance Attribute Details

#hourInteger (readonly)

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

Returns:

  • (Integer)


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

def hour
  @hour
end

#minuteInteger (readonly)

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

Returns:

  • (Integer)


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

def minute
  @minute
end

#typeString (readonly)

Indicates the type of the event.

Returns:

  • (String)


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

def type
  @type
end