From: luka luka Date: 2008-05-03T22:20:46+09:00 Subject: Re: a ? b : c Todd Benson wrote: > x = 6 # assignment > y = x == 5 ? 0 : 2 > # if x equals 5, then assign 0 to y > # else assign 2 to y > > It's the same as y = (x == 5 ? 0 : 2), because in ruby, == takes > precedence over = (as does the ternary operation) > > See http://en.wikipedia.org/wiki/%3F: for more info on ternary op. > > hth, > Todd Thanks man. I just understand (: -- Posted via http://www.ruby-forum.com/.