Class: Feriados::Rules::DayOfMonth

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

Instance Attribute Summary

Attributes inherited from RuleBase

#name

Instance Method Summary collapse

Methods inherited from RuleBase

#==, #eql?, #hash

Constructor Details

#initialize(day, month, name = nil) ⇒ DayOfMonth

Returns a new instance of DayOfMonth.



4
5
6
7
8
# File 'lib/feriados/rules/day_of_month.rb', line 4

def initialize(day, month, name = nil)
  super(name)
  @day = day
  @month = month
end

Instance Method Details

#holiday?(date) ⇒ Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/feriados/rules/day_of_month.rb', line 10

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