Class: Feriados::Rules::FixDate

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

Instance Method Summary collapse

Methods inherited from RuleBase

#==, #eql?, #hash

Constructor Details

#initialize(year, month, day) ⇒ FixDate

Returns a new instance of FixDate.



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

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

Instance Method Details

#holiday?(date) ⇒ Boolean

Returns:

  • (Boolean)


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

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