Download Firefox: WindowsMac OS X
logo       
Google Custom Search
    AddThis Social Bookmark Button

Re: how do I convince Hash that two keys are the same?: msg#00056

Subject: Re: how do I convince Hash that two keys are the same?
Gavin Sinclair wrote:
...
I think it's valuable and would like someone to commit it, once an
example has been found.  I think a good example is

  class Details
    attr_accessor :name, :age
    def ==(other)
      @name = other.name and @age = other.age

        @name == other.name and @age == other.age
---------------^_____________________^


No?

James




<Prev in Thread] Current Thread [Next in Thread>