Dan Doel
11/25/2003 10:23:00 PM
Oops, that's slightly broken. Here's a fix.
class Range
alias_method :old_include?, :include?
def include?(obj)
if obj.is_a? Range
old_include? obj.first and
old_include? obj.exclude_end? ? obj.last-1 : obj.last
else
old_include? obj
end
end
def intersect?(aRange)
aRange.each do |i|
return true if include? i
end
false
end
end