Class: LibTAD::Astronomy::AstronomyLocation
- Inherits:
-
Object
- Object
- LibTAD::Astronomy::AstronomyLocation
- Defined in:
- lib/types/astronomy/astronomy_location.rb
Overview
Information about location and astronomical objects requested.
Instance Attribute Summary collapse
-
#geo ⇒ GeoType
readonly
Geographical information about the location.
-
#id ⇒ String
readonly
The id of the location.
-
#matchparam ⇒ String
readonly
The part of the queried placeid that this location matches.
-
#objects ⇒ Array<AstronomyObjectDetails>
readonly
Requested astronomical information.
Instance Method Summary collapse
-
#initialize(hash) ⇒ AstronomyLocation
constructor
A new instance of AstronomyLocation.
Constructor Details
#initialize(hash) ⇒ AstronomyLocation
Returns a new instance of AstronomyLocation.
21 22 23 24 25 26 27 28 |
# File 'lib/types/astronomy/astronomy_location.rb', line 21 def initialize(hash) @id = hash.fetch('id', nil) @matchparam = hash.fetch('matchparam', nil) @geo = ::LibTAD::Places::Geo.new hash.fetch('geo', nil) @objects = hash.fetch('astronomy', nil) &.fetch('objects', nil) &.map { |e| AstronomyObjectDetails.new(e) } end |
Instance Attribute Details
#geo ⇒ GeoType (readonly)
Geographical information about the location.
15 16 17 |
# File 'lib/types/astronomy/astronomy_location.rb', line 15 def geo @geo end |
#id ⇒ String (readonly)
The id of the location.
7 8 9 |
# File 'lib/types/astronomy/astronomy_location.rb', line 7 def id @id end |
#matchparam ⇒ String (readonly)
The part of the queried placeid that this location matches.
11 12 13 |
# File 'lib/types/astronomy/astronomy_location.rb', line 11 def matchparam @matchparam end |
#objects ⇒ Array<AstronomyObjectDetails> (readonly)
Requested astronomical information.
19 20 21 |
# File 'lib/types/astronomy/astronomy_location.rb', line 19 def objects @objects end |