Am I fundamentally misunderstanding Ruby here? I\'ve been writing Ruby code for about 2 years now and just today stumbled on this...
ruby-1.8.7-p249 > i =
As others have elucidated above, the keyword and is used when you want to put two different statements on one line. It is just a nicer way of making your code readable.
Thus,
i = true and false
implies i = true; false #(a less widely used code layout in ruby)
or which is the most straightforward way:
i = true
false
So, the output is correct. Otherwise, if you were expecting false, then use the boolean and &&.