Sha256: 74571809b7f7b102dd014a5f32642292047b8a78445bb5db052ea8a15ae0624f

Contents?: true

Size: 413 Bytes

Versions: 45

Compression:

Stored size: 413 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

45 entries across 45 versions & 6 rubygems

Version Path
mongo_mapper-unstable-2010.1.29 lib/mongo_mapper/plugins/equality.rb
mongo_mapper-unstable-2010.1.28 lib/mongo_mapper/plugins/equality.rb
mongo_mapper-unstable-2010.1.27 lib/mongo_mapper/plugins/equality.rb
mongo_mapper-unstable-2010.1.26 lib/mongo_mapper/plugins/equality.rb
mongo_mapper-unstable-2010.1.25 lib/mongo_mapper/plugins/equality.rb