Method: Range#&
- Defined in:
- lib/combinatorics/extensions/range.rb
#&(other) ⇒ Range
Finds the intersecting sub-range.
20 21 22 23 24 25 |
# File 'lib/combinatorics/extensions/range.rb', line 20 def &(other) Range.new( [self.first, other.first].max, [self.last, other.last].min ) end |