Sha256: b4150945ac684665b2ca14c8e69353623098f018558e2036147fead5534caa33

Contents?: true

Size: 389 Bytes

Versions: 2

Compression:

Stored size: 389 Bytes

Contents

module MongoMapper
  module Plugins
    module Equality
      module InstanceMethods
        def ==(other)
          other.is_a?(self.class) && _id == other._id
        end

        def eql?(other)
          self == other
        end

        def equal?(other)
          object_id === other.object_id
        end

        def hash
          _id.hash
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
pwnash-mongo_mapper-0.7.5 lib/mongo_mapper/plugins/equality.rb
mongo_mapper-0.7.6 lib/mongo_mapper/plugins/equality.rb