class Object # Is self included in other? # # 5.in?(0..10) #=> true # 5.in?([0,1,2,3]) #=> false # def in?(other) other.include?(self) end end # _____ _ # |_ _|__ ___| |_ # | |/ _ \/ __| __| # | | __/\__ \ |_ # |_|\___||___/\__| # =begin test require 'test/unit' class TCKernel < Test::Unit::TestCase def test_in? assert( 5.in?(0..10) ) assert( 5.in?([1,2,3,4,5]) ) end end =end