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

===, #to_h

Constructor Details

#initialize(weekday:) ⇒ Weekday

Returns a new instance of Weekday.



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

def initialize(weekday:)
  @weekday = weekday
end

Instance Method Details

#include?(date) ⇒ Boolean

Returns:

  • (Boolean)


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

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