Class: HolidaysRules::Rules::DayOfMonth

Inherits:
RuleBase
  • Object
show all
Defined in:
lib/holidays_rules/rules.rb

Instance Method Summary collapse

Methods inherited from RuleBase

#==, #eql?, #hash

Constructor Details

#initialize(day, month) ⇒ DayOfMonth



34
35
36
37
# File 'lib/holidays_rules/rules.rb', line 34

def initialize(day, month)
  @day = day
  @month = month
end

Instance Method Details

#holiday?(date) ⇒ Boolean



39
40
41
# File 'lib/holidays_rules/rules.rb', line 39

def holiday?(date)
  @day == date.day && @month == date.month
end