From: Michael Judge Date: 2007-06-26T05:53:35+09:00 Subject: .include?/.within? and English-thinking brains In English, it's clearer to ask, "Is Maggie one of the guests?" -- rather than the awkward, "Does the guests include Maggie?" So why in Ruby, do we write, "list.include? scalar" -- when we often mean, "scalar.within? list" ?! The solution: module Comparable def within?(list) list.include? self end end # # Examples: # 1.within? [1,2,3] # => true 1.within? [2,3] # => false "arr".within? "arr, matey" # => true "arr".within? "monkey patch" # => false 1.within?( 1 => "value" ) # => true 1.within?( 2 => "value" ) # => false 1.within? 1..3 # => true 1.within? 2..3 # => false Try it for a morning, your brain will feel better.