On 11 February 2010 00:57, fearless_fool <[email protected]> wrote:
> Essentially, I've caught the <=> operator
> returning nil -- not -1, 0, or 1, but nil.  Schematically:

Do you need the <=> operator? (specifically, nothing you're doing
seems to care whether the compared string is bigger or smaller, only
different. So why not use != instead?

In fact, your matches? method could just as easily be:

def matches?(s)
   s == @slot
 end

which will return true if they're equal, or nil if they're not. If it
has to be true/false, then use !!(s == @slot)

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to