From: Peter Vandenabeele Date: 2011-09-24T18:47:58+09:00 Subject: Re: Conditional statements with multiple arguments --0016e6506fd606308204adacd2be Content-Type: text/plain; charset=UTF-8 On Sat, Sep 24, 2011 at 11:19 AM, Thomas B. wrote: > Ok, that makes a lot more sense. So basically, what you're saying is if > I had a single argument in a conditional statement (even a variable?) it > would evaluate to true? > Unless it is "nil" or "false" > I.e.: > > x = 1 > > if x > puts x > end > > If I'm understanding this correctly, the above statement will just > evaluate to true? Or is this only true with a string? > > Sorry if this all sounds a bit stupid, but I'm just trying to fully > grasp the concept of how arguments are evaluated in conditional > statements. > There are only 2 objects that are "false": * false * nil All the rest is "true", e.g. * 0 # zero * [] # emtpy array * "" # empty string are all "true" Peter --0016e6506fd606308204adacd2be--