Class: Astronoby::Constellation

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

Overview

Represents an IAU constellation with its full name and standard three-letter abbreviation.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, abbreviation) ⇒ Constellation

Returns a new instance of Constellation.

Parameters:

  • name (String)

    the constellation name

  • abbreviation (String)

    the IAU abbreviation



15
16
17
18
# File 'lib/astronoby/constellation.rb', line 15

def initialize(name, abbreviation)
  @name = name
  @abbreviation = abbreviation
end

Instance Attribute Details

#abbreviationString (readonly)

Returns the IAU three-letter abbreviation (e.g., “Ori”).

Returns:

  • (String)

    the IAU three-letter abbreviation (e.g., “Ori”)



11
12
13
# File 'lib/astronoby/constellation.rb', line 11

def abbreviation
  @abbreviation
end

#nameString (readonly)

Returns the constellation name (e.g., “Orion”).

Returns:

  • (String)

    the constellation name (e.g., “Orion”)



8
9
10
# File 'lib/astronoby/constellation.rb', line 8

def name
  @name
end