Is there a way to check if a range is within the boundaries of another
range?
(1…10) === (3…6) => return false
I know I could re-open the range class and write a method that loops
through and checks with include? like this?
class Range
def range_included?(range)
range.each do |n|
if !self.include(n)
return false
end
end
true
end
end
but just wanted to see if there was something cleaner.