[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ruby-talk
Subject:    Re: parent of TrueClass, FalseClass
From:       Ryan Pavlik <rpav () mephle ! com>
Date:       2004-04-01 18:21:04
Message-ID: 20040401102102.171ec510.rpav () mephle ! com
[Download RAW message or body]

On Fri, 2 Apr 2004 03:14:26 +0900
"Ara.T.Howard" <Ara.T.Howard@noaa.gov> wrote:

> 
> any good reason these would not have a common parent Bool or something?
> 
>   case arg
>     when Bool
>       ...
>   end

Here's the solution I use:

    module Boolean; end
    
    class  TrueClass;  include Boolean; end
    class  FalseClass; include Boolean; end

hth,

-- 
Ryan Pavlik <rpav@mephle.com>

"I'm a mere Feather Fall spell away from safety." - 8BT

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic