From: andrew.oxenburgh@... Date: 2007-12-12T00:39:58+09:00 Subject: Re: Set and Object equivilence Thanks. Bit embarrassed with a simple spelling error. I looked at it for ages, and tried all sorts of permutations and combinations of set c'strs and adding methods! I'll check out the Comparable mixin as well. Regards On Dec 11, 3:30 pm, "Eric I." wrote: > Hi Andrew, > > First, change your .eqls? method to .eql? and that will fix your code. > > Also, you should look into the Comparable mix-in module. Basically, > if you define the spaceship operator (<=>) and include Comparable in > your class, it will define it will define all the relational operators > (==, <, <=, >, >=) and between? for you. Plus, != is internally > implemented as the boolean negation of ==, so you get that also. > > For Set member equality, two methods are used -- eql? and hash. > > Eric > > ==== > > On-site, hands-on Ruby training is available fromhttp://LearnRuby.com > !