Sha256: 74d414465255bd8393c5fd61c7105e5e75b7b18aa8090fc2e8684559e1a6d3c6

Contents?: true

Size: 485 Bytes

Versions: 13

Compression:

Stored size: 485 Bytes

Contents

module Toy
  module Equality
    def eql?(other)
      return true if self.class.eql?(other.class) && id == other.id
      return true if other.respond_to?(:target) &&
                     self.class.eql?(other.target.class) &&
                     id == other.target.id
      false
    end
    alias :== :eql?

    def equal?(other)
      if other.respond_to?(:proxy_respond_to?) && other.respond_to?(:target)
        other = other.target
      end
      super other
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
toystore-0.8.3 lib/toy/equality.rb
toystore-0.8.2 lib/toy/equality.rb
toystore-0.8.1 lib/toy/equality.rb
toystore-0.8.0 lib/toy/equality.rb
toystore-0.7.0 lib/toy/equality.rb
toystore-0.6.6 lib/toy/equality.rb
toystore-0.6.5 lib/toy/equality.rb
toystore-0.6.4 lib/toy/equality.rb
toystore-0.6.3 lib/toy/equality.rb
toystore-0.6.2 lib/toy/equality.rb
toystore-0.6.1 lib/toy/equality.rb
toystore-0.6 lib/toy/equality.rb
toystore-0.5 lib/toy/equality.rb