From: vimal Date: 2009-02-19T18:19:51+09:00 Subject: Re: simple question re: ruby warning message On Feb 19, 1:59 pm, Tom Cloyd wrote: > I just set up my first ternary operator expression, and got a warning > from Ruby, as a reward! I don't see what the problem might be: > > The expression: > db_type= 'n' ? db = @nodes_h : db = @links_h I guess your representation (db_type= 'n') doesn't look like a condition, its like performing an assignment. If its a condition it should be db_type == 'n' Your representation (db_type= 'n' ? db = @nodes_h : db = @links_h) assigns db_type the result of the following: checks a condition 'n' if true db = @nodes_h else db = @links_h end Regards, Vimal Das