Class: MoonPhase

Inherits:
Weatherzone::Resource show all
Defined in:
lib/weatherzone/resources/moon_phase.rb

Constant Summary collapse

PHASE_TEXT_TRANSLATIONS =
{
  "1st quarter" => "First quarter",
  "Full moon" => "Full moon",
  "3rd quarter" => "Last quarter",
  "New moon" => "New moon"
}

Instance Method Summary collapse

Methods inherited from Weatherzone::Resource

has_attribute, has_elements, inherited, #settings

Instance Method Details

#dateObject



15
16
17
# File 'lib/weatherzone/resources/moon_phase.rb', line 15

def date
  Date.parse(@date)
end

#phase_textObject



19
20
21
# File 'lib/weatherzone/resources/moon_phase.rb', line 19

def phase_text
  PHASE_TEXT_TRANSLATIONS[moon_phase_phase_text]
end