Class: LibTAD::Astronomy::AstronomyLocation

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

Overview

Information about location and astronomical objects requested.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#geoGeoType (readonly)

Geographical information about the location.

Returns:

  • (GeoType)


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

def geo
  @geo
end

#idString (readonly)

The id of the location.

Returns:

  • (String)


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

def id
  @id
end

#matchparamString (readonly)

The part of the queried placeid that this location matches.

Returns:

  • (String)


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

def matchparam
  @matchparam
end

#objectsArray<AstronomyObjectDetails> (readonly)

Requested astronomical information.

Returns:



19
20
21
# File 'lib/types/astronomy/astronomy_location.rb', line 19

def objects
  @objects
end