Class: HolidaysRules::Rules::FixWeekDay
- Defined in:
- lib/holidays_rules/rules.rb
Instance Method Summary collapse
- #holiday?(date) ⇒ Boolean
-
#initialize(week, wday, month) ⇒ FixWeekDay
constructor
A new instance of FixWeekDay.
Methods inherited from RuleBase
Constructor Details
#initialize(week, wday, month) ⇒ FixWeekDay
Returns a new instance of FixWeekDay.
124 125 126 127 128 |
# File 'lib/holidays_rules/rules.rb', line 124 def initialize(week, wday, month) @week = week @wday = wday @month = month end |
Instance Method Details
#holiday?(date) ⇒ Boolean
130 131 132 133 |
# File 'lib/holidays_rules/rules.rb', line 130 def holiday?(date) week = (date.day - 1) / 7 + 1 @wday == date.wday && @month == date.month && @week == week end |