Class: Repeatable::Expression::WeekdayInMonth
- Defined in:
- lib/repeatable/expression/weekday_in_month.rb
Instance Method Summary collapse
- #include?(date) ⇒ Boolean
-
#initialize(weekday:, count:) ⇒ WeekdayInMonth
constructor
A new instance of WeekdayInMonth.
Methods inherited from Date
Methods inherited from Base
===, #difference, #intersection, #to_h, #union
Constructor Details
#initialize(weekday:, count:) ⇒ WeekdayInMonth
Returns a new instance of WeekdayInMonth.
4 5 6 7 |
# File 'lib/repeatable/expression/weekday_in_month.rb', line 4 def initialize(weekday:, count:) @weekday = weekday @count = count end |
Instance Method Details
#include?(date) ⇒ Boolean
9 10 11 |
# File 'lib/repeatable/expression/weekday_in_month.rb', line 9 def include?(date) day_matches?(date) && week_matches?(date) end |