Returns the first and last values of a range.
(1..9).bounds #=> [1, 9]Returns two concatenated ranges.
(1..3).combine(7..9) #=> [1, 2, 3, 7, 8, 9]Returns if a range is within another open ended range.
(1..5).include_with_range?(1) # => true
(1..5).include_with_range?(2..3) # => true
(1..5).include_with_range?(7) # => false
(1..5).include_with_range?(2..6) # => falseReturns if two ranges overlap each other.
(1..5).overlaps?(4..6) # => true
(1..5).overlaps?(7..9) # => falseReturns a random element from the range.
(1..5).sample # => 4Returns a copy of a shuffled range of elements.
(1..5).shuffle # => [2, 5, 1, 4, 3]
(1..5).shuffle! # => [3, 4, 5, 2, 1]Returns if one range is within another.
(1..5).within?(2..4) # => true
(1..5).within?(4..6) # => false