Class: Boundy::Time::Comparator
- Inherits:
-
Object
- Object
- Boundy::Time::Comparator
- Includes:
- Comparator
- Defined in:
- lib/boundy/time/comparator.rb
Class Method Summary collapse
Instance Method Summary collapse
- #after? ⇒ Boolean
- #before? ⇒ Boolean
-
#initialize(bound, time) ⇒ Comparator
constructor
A new instance of Comparator.
- #within? ⇒ Boolean
Methods included from Comparator
Constructor Details
#initialize(bound, time) ⇒ Comparator
Returns a new instance of Comparator.
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/boundy/time/comparator.rb', line 12 def initialize(bound, time) if bound.nil? raise end if time.nil? raise end other = Boundy::Bound.new(time) @comparator = Boundy::Bound::Comparator.new(bound, other) end |
Class Method Details
.types ⇒ Object
6 7 8 |
# File 'lib/boundy/time/comparator.rb', line 6 def self.types [::Time, ActiveSupport::TimeWithZone] end |
Instance Method Details
#after? ⇒ Boolean
24 25 26 |
# File 'lib/boundy/time/comparator.rb', line 24 def after? @comparator.after? end |
#before? ⇒ Boolean
28 29 30 |
# File 'lib/boundy/time/comparator.rb', line 28 def before? @comparator.before? end |
#within? ⇒ Boolean
32 33 34 |
# File 'lib/boundy/time/comparator.rb', line 32 def within? @comparator.within? end |