Class: HolidaysRules::Rules::DayOfWeek

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(wday) ⇒ DayOfWeek

Returns a new instance of DayOfWeek.



18
19
20
# File 'lib/holidays_rules/rules.rb', line 18

def initialize(wday)
  @wday = wday
end

Instance Method Details

#holiday?(date) ⇒ Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/holidays_rules/rules.rb', line 22

def holiday?(date)
  @wday == date.wday
end