Class: Repeatable::Expression::Weekday

Inherits:
Date
  • Object
show all
Defined in:
lib/repeatable/expression/weekday.rb

Instance Method Summary collapse

Methods inherited from Date

#==, #hash, #to_h

Methods inherited from Base

===, #difference, #intersection, #to_h, #union

Constructor Details

#initialize(weekday:) ⇒ Weekday



4
5
6
# File 'lib/repeatable/expression/weekday.rb', line 4

def initialize(weekday:)
  @weekday = weekday
end

Instance Method Details

#include?(date) ⇒ Boolean



8
9
10
# File 'lib/repeatable/expression/weekday.rb', line 8

def include?(date)
  date.wday == weekday
end