Class: Range
- Inherits:
-
Object
- Object
- Range
- Defined in:
- lib/yol_common/range.rb
Instance Method Summary collapse
- #intersection(other) ⇒ Object (also: #&)
Instance Method Details
#intersection(other) ⇒ Object Also known as: &
4 5 6 7 |
# File 'lib/yol_common/range.rb', line 4 def intersection(other) return nil if (self.max < other.begin or other.max < self.begin) [self.begin,other.begin].max..[self.max,other.max].min end |