Class: OpenHAB::Core::Actions::Ephemeris

Inherits:
Object
  • Object
show all
Defined in:
lib/openhab/core/actions/ephemeris.rb

Overview

Class Method Summary collapse

Class Method Details

.holiday_name(holiday) ⇒ String?

Human readable name of the given holiday

Examples:

Ephemeris.holiday_name(Date.today) # => "Christmas"
Ephemeris.holiday_name(:christmas) # => "Christmas"

Parameters:

  • holiday (Symbol, #holiday, nil)

Returns:

  • (String, nil)


19
20
21
22
23
24
# File 'lib/openhab/core/actions/ephemeris.rb', line 19

def holiday_name(holiday)
  holiday = holiday.holiday if holiday.respond_to?(:holiday)
  return nil if holiday.nil?

  ::Ephemeris.get_holiday_description(to_holiday_property_key(holiday))
end