I know that in Ruby, all numbers, including zero, evaluate to true when used in a conditional statement. However, what method is being called to perform this evaluation (see Ex. 2 below)? I thought it might be the == operator, but not so as they return opposite results.
Example 1: The equality method evaluates zero to false
>> puts "0 is " << (0 == true ? "true" : "false") 0 is false
Example 2: Yet zero alone evaluates to true, because it is not nil
>> puts "0 is " << (0 ? "true" : "false") 0 is true