Class: Astronoby::Opposition

Inherits:
Object
  • Object
show all
Defined in:
lib/astronoby/events/opposition.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(instant:, body:) ⇒ Opposition

Returns a new instance of Opposition.

Parameters:



13
14
15
16
17
# File 'lib/astronoby/events/opposition.rb', line 13

def initialize(instant:, body:)
  @instant = instant
  @body = body
  freeze
end

Instance Attribute Details

#bodyAstronoby::Body (readonly)

Returns the body in opposition with the Sun.

Returns:



9
10
11
# File 'lib/astronoby/events/opposition.rb', line 9

def body
  @body
end

#instantAstronoby::Instant (readonly)

Returns when the opposition occurs.

Returns:



6
7
8
# File 'lib/astronoby/events/opposition.rb', line 6

def instant
  @instant
end