Class: LibTAD::Astronomy::AstronomyObjectDetails

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

Overview

Information about an astronomy object.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#currentAstronomyCurrent (readonly)

The current data for the object. Only if requested.

Returns:



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

def current
  @current
end

#daysArray<AstronomyDay> (readonly)

Lists and wraps all requested days where events are happening.

Returns:



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

def days
  @days
end

#nameString (readonly)

Object name.

Returns:

  • (String)


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

def name
  @name
end

#resultsArray<AstronomyCurrent> (readonly)

The specific data for the object at isotime/utctime.

Returns:



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

def results
  @results
end