Class: Repeatable::Expression::Weekday
- Defined in:
- lib/repeatable/expression/weekday.rb
Instance Method Summary collapse
- #include?(date) ⇒ Boolean
-
#initialize(weekday:) ⇒ Weekday
constructor
A new instance of Weekday.
Methods inherited from Date
Methods inherited from Base
===, #deconstruct_keys, #difference, #intersection, #to_h, #union
Constructor Details
#initialize(weekday:) ⇒ Weekday
Returns a new instance of Weekday.
7 8 9 |
# File 'lib/repeatable/expression/weekday.rb', line 7 def initialize(weekday:) @weekday = weekday end |
Instance Method Details
#include?(date) ⇒ Boolean
12 13 14 |
# File 'lib/repeatable/expression/weekday.rb', line 12 def include?(date) date.wday == weekday end |