Class: Availability::Exclusion::Rule::BeforeDate

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

Instance Method Summary collapse

Methods inherited from InstanceVariableComparability

#<=>

Constructor Details

#initialize(date) ⇒ BeforeDate

Returns a new instance of BeforeDate.



94
95
96
# File 'lib/availability/exclusion.rb', line 94

def initialize(date)
  @date = date
end

Instance Method Details

#violated_by?(time) ⇒ Boolean

Returns:

  • (Boolean)


98
99
100
# File 'lib/availability/exclusion.rb', line 98

def violated_by?(time)
  time.to_date < @date
end