Farrel Lifson
1/15/2007 11:57:00 AM
On 15/01/07, Peter Szinek <peter@rubyrailways.com> 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