Class: Availability::Exclusion::Rule::BeforeDateAndTime

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

Instance Method Summary collapse

Methods inherited from InstanceVariableComparability

#<=>

Constructor Details

#initialize(time) ⇒ BeforeDateAndTime

Returns a new instance of BeforeDateAndTime.



104
105
106
107
# File 'lib/availability/exclusion.rb', line 104

def initialize(time)
  @before_date = BeforeDate.new time.to_date
  @before_time = BeforeTime.new time
end

Instance Method Details

#violated_by?(time) ⇒ Boolean

Returns:

  • (Boolean)


109
110
111
# File 'lib/availability/exclusion.rb', line 109

def violated_by?(time)
  @before_date.violated_by?(time) || @before_time.violated_by?(time)
end