Class: LibTAD::Astronomy::AstronomyObjectDetails
- Inherits:
-
Object
- Object
- LibTAD::Astronomy::AstronomyObjectDetails
- Defined in:
- lib/types/astronomy/astronomy_object_details.rb
Overview
Information about an astronomy object.
Instance Attribute Summary collapse
-
#current ⇒ AstronomyCurrent
readonly
The current data for the object.
-
#days ⇒ Array<AstronomyDay>
readonly
Lists and wraps all requested days where events are happening.
-
#name ⇒ String
readonly
Object name.
-
#results ⇒ Array<AstronomyCurrent>
readonly
The specific data for the object at isotime/utctime.
Instance Method Summary collapse
-
#initialize(hash) ⇒ AstronomyObjectDetails
constructor
A new instance of AstronomyObjectDetails.
Constructor Details
#initialize(hash) ⇒ AstronomyObjectDetails
Returns a new instance of AstronomyObjectDetails.
21 22 23 24 25 26 27 28 29 |
# File 'lib/types/astronomy/astronomy_object_details.rb', line 21 def initialize(hash) @name = hash.fetch('name', nil) @days = hash.fetch('days', nil) &.map { |e| AstronomyDay.new(e) } @current = AstronomyCurrent.new hash['current'] unless !hash.key?('current') @results = hash.fetch('results', nil) &.map { |e| AstronomyCurrent.new(e) } end |
Instance Attribute Details
#current ⇒ AstronomyCurrent (readonly)
The current data for the object. Only if requested.
15 16 17 |
# File 'lib/types/astronomy/astronomy_object_details.rb', line 15 def current @current end |
#days ⇒ Array<AstronomyDay> (readonly)
Lists and wraps all requested days where events are happening.
11 12 13 |
# File 'lib/types/astronomy/astronomy_object_details.rb', line 11 def days @days end |
#name ⇒ String (readonly)
Object name.
7 8 9 |
# File 'lib/types/astronomy/astronomy_object_details.rb', line 7 def name @name end |
#results ⇒ Array<AstronomyCurrent> (readonly)
The specific data for the object at isotime/utctime.
19 20 21 |
# File 'lib/types/astronomy/astronomy_object_details.rb', line 19 def results @results end |