Class: LibTAD::Astronomy::MoonPhase
- Inherits:
-
Object
- Object
- LibTAD::Astronomy::MoonPhase
- Defined in:
- lib/types/astronomy/moonphase.rb
Overview
Moon phase.
Instance Attribute Summary collapse
-
#id ⇒ String
readonly
Moonphase id.
Instance Method Summary collapse
-
#description ⇒ String
Moonphase description.
-
#initialize(id) ⇒ MoonPhase
constructor
A new instance of MoonPhase.
Constructor Details
#initialize(id) ⇒ MoonPhase
Returns a new instance of MoonPhase.
32 33 34 |
# File 'lib/types/astronomy/moonphase.rb', line 32 def initialize(id) @id = id end |
Instance Attribute Details
#id ⇒ String (readonly)
Moonphase id.
7 8 9 |
# File 'lib/types/astronomy/moonphase.rb', line 7 def id @id end |
Instance Method Details
#description ⇒ String
Moonphase description.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/types/astronomy/moonphase.rb', line 11 def description case @id when 'newmoon' 'New moon' when 'waxingcrescent' 'Waxing crescent' when 'firstquarter' 'Moon in first quarter' when 'waxinggibbous' 'Waxing gibbous moon' when 'fullmoon' 'Full moon' when 'waninggibbous' 'Waning gibbous moon' when 'thirdquarter' 'Moon in third quarter' when 'waningcrescent' 'Waning crescent moon' end end |