From: Evan Webb Date: 2004-02-18T12:14:58+09:00 Subject: Re: boolean to int conversion A few different ways: 1) v = value ? 1 : 0 where value is either true or false 2) class TrueClass; def to_i; 1; end; end class FalseClass; def to_i; 0; end; end Evan Webb // evan@fallingsnow.net On Tue, 2004-02-17 at 19:09, Cere Davis wrote: > I'm a bit of a Ruby newbie so be kind pls. > > Could someone tell me if there's an easy way to make a value of True go to 1 and False goto 0? > > a sort of to_i method? > > Thanks, > Cere > > >