Class: Repeatable::Expression::DayInMonth
- Defined in:
- lib/repeatable/expression/day_in_month.rb
Instance Method Summary collapse
- #include?(date) ⇒ Boolean
-
#initialize(day:) ⇒ DayInMonth
constructor
A new instance of DayInMonth.
Methods inherited from Date
Methods inherited from Base
===, #difference, #intersection, #to_h, #union
Constructor Details
#initialize(day:) ⇒ DayInMonth
Returns a new instance of DayInMonth.
4 5 6 |
# File 'lib/repeatable/expression/day_in_month.rb', line 4 def initialize(day:) @day = day end |
Instance Method Details
#include?(date) ⇒ Boolean
8 9 10 11 12 13 14 |
# File 'lib/repeatable/expression/day_in_month.rb', line 8 def include?(date) if day.to_s == 'last' date.next_day.month != date.month else date.day == day end end |