From: Tomoyuki Kosimizu Date: 2003-11-27T09:42:02+09:00 Subject: Re: Range does not take an Range object. I am happy that there were at least three persons (included me) who implemented Range#include? or intersect? incorrectly in the world. And, interestingly, each person implement them in different way. It seems valuable that include? and intersect? are built-in. greentea2fa2.so-net.ne.jp class Range alias_method :original_include?, :include? def include?(other) return original_include?(other) unless other.is_a?(Range) return other.first >= first && other.last <= last end def intersect?(other) return true if include?(other) return include?(other.last) || include?(other.first) || other.include?(first) || other.include?(last) end end