Class: Availability::Exclusion::Rule::OnDayOfWeek

Inherits:
InstanceVariableComparability show all
Defined in:
lib/availability/exclusion.rb

Instance Method Summary collapse

Methods inherited from InstanceVariableComparability

#<=>

Constructor Details

#initialize(day_of_week) ⇒ OnDayOfWeek

Returns a new instance of OnDayOfWeek.



135
136
137
# File 'lib/availability/exclusion.rb', line 135

def initialize(day_of_week)
  @day_of_week = day_of_week
end

Instance Method Details

#violated_by?(time) ⇒ Boolean

Returns:

  • (Boolean)


139
140
141
# File 'lib/availability/exclusion.rb', line 139

def violated_by?(time)
  time.wday == @day_of_week
end