Class: Range
Instance Method Summary collapse
Instance Method Details
#include_with_range?(value) ⇒ Boolean
4 5 6 7 8 9 10 11 |
# File 'lib/active_object/range.rb', line 4 def include_with_range?(value) if value.is_a?(::Range) operator = exclude_end? && !value.exclude_end? ? :< : :<= include?(value.first) && value.last.send(operator, last) else include?(value) end end |
#overlaps?(other) ⇒ Boolean
15 16 17 |
# File 'lib/active_object/range.rb', line 15 def overlaps?(other) cover?(other.first) || other.cover?(first) end |