From: Farrel Lifson Date: 2007-01-15T20:56:33+09:00 Subject: Re: cannot return negative value ? On 15/01/07, Peter Szinek wrote: > Josselin wrote: > > I got the following error : > > > > parse error, unexpected tUMINUS_NUM > > > > userCredential.flagged? ? return -1 : return 1 > You mean > > return userCredential.flagged? -1 : 1 > > ? > > I am not sure in Ruby, but if it's the same than in C or anywhere else, > the ternary operator evaluates to a value, and you can not really > execute things like this inside... > > Cheers, > Peter This seems to work though userCredentials.flagged? ? (return -1) : (return 1) Farrel