Class: LibTAD::Astronomy::AstronomyEvent
- Inherits:
-
Object
- Object
- LibTAD::Astronomy::AstronomyEvent
- Defined in:
- lib/types/astronomy/astronomy_event.rb
Overview
Information about a sunrise/sunset event for a specific day.
Instance Attribute Summary collapse
-
#hour ⇒ Integer
readonly
Hour at which the event is happening (local time).
-
#minute ⇒ Integer
readonly
Minute at which the event is happening (local time).
-
#type ⇒ String
readonly
Indicates the type of the event.
Instance Method Summary collapse
-
#initialize(hash) ⇒ AstronomyEvent
constructor
A new instance of AstronomyEvent.
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
#hour ⇒ Integer (readonly)
Hour at which the event is happening (local time).
11 12 13 |
# File 'lib/types/astronomy/astronomy_event.rb', line 11 def hour @hour end |
#minute ⇒ Integer (readonly)
Minute at which the event is happening (local time).
15 16 17 |
# File 'lib/types/astronomy/astronomy_event.rb', line 15 def minute @minute end |
#type ⇒ String (readonly)
Indicates the type of the event.
7 8 9 |
# File 'lib/types/astronomy/astronomy_event.rb', line 7 def type @type end |