On Wed, Mar 12, 2008 at 12:59 PM, <wojtek@m4chu.net> wrote:
> Hi,
>
> I wonder if there is a built-in method which does just like:
>
> range.include?(obj)
>
> but for the obj object. I came up with something like:
>
> module Comparable
> def in?(range)
> range.in?(self)
> end
> end
>
> 1.in? (1..10) # => true
>
> Of course I can use the range.include? syntax, but I find the second
> approach more convenient 
>
> Regards,
> m4chu
I personally am not a fan of such methods, but perhaps
Comparable#between will satisfy you.
Daniel Brumbaugh Keeney