Class: Boundy::Range::Comparator
- Inherits:
-
Object
- Object
- Boundy::Range::Comparator
- Includes:
- Comparator
- Defined in:
- lib/boundy/range/comparator.rb
Class Method Summary collapse
Instance Method Summary collapse
- #after? ⇒ Boolean
- #before? ⇒ Boolean
-
#initialize(domain, range) ⇒ Comparator
constructor
A new instance of Comparator.
- #within? ⇒ Boolean
Methods included from Comparator
Constructor Details
#initialize(domain, range) ⇒ Comparator
Returns a new instance of Comparator.
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/boundy/range/comparator.rb', line 12 def initialize(domain, range) if domain.nil? raise end if range.nil? raise end other = Boundy::Domain.new(range.begin, range.end) @comparator = Boundy::Domain::Comparator.new(domain, other) end |
Class Method Details
.type ⇒ Object
6 7 8 |
# File 'lib/boundy/range/comparator.rb', line 6 def self.type ::Range end |
Instance Method Details
#after? ⇒ Boolean
25 26 27 |
# File 'lib/boundy/range/comparator.rb', line 25 def after? @comparator.after? end |
#before? ⇒ Boolean
29 30 31 |
# File 'lib/boundy/range/comparator.rb', line 29 def before? @comparator.before? end |
#within? ⇒ Boolean
33 34 35 |
# File 'lib/boundy/range/comparator.rb', line 33 def within? @comparator.within? end |