Class: Availability::Exclusion::Rule::BeforeTime
- Inherits:
-
InstanceVariableComparability
- Object
- InstanceVariableComparability
- Availability::Exclusion::Rule::BeforeTime
- Defined in:
- lib/availability/exclusion.rb
Instance Method Summary collapse
-
#initialize(date_or_time) ⇒ BeforeTime
constructor
A new instance of BeforeTime.
- #violated_by?(time) ⇒ Boolean
Methods inherited from InstanceVariableComparability
Constructor Details
#initialize(date_or_time) ⇒ BeforeTime
Returns a new instance of BeforeTime.
115 116 117 |
# File 'lib/availability/exclusion.rb', line 115 def initialize(date_or_time) @compare_to = date_or_time.to_time end |
Instance Method Details
#violated_by?(time) ⇒ Boolean
119 120 121 |
# File 'lib/availability/exclusion.rb', line 119 def violated_by?(time) time.to_time.seconds_since_midnight < @compare_to.to_time.seconds_since_midnight end |