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-0.7.5 lib/mongo_mapper/plugins/equality.rb
mongo_mapper_ign-0.7.4 lib/mongo_mapper/plugins/equality.rb
mongo_mapper-0.7.4 lib/mongo_mapper/plugins/equality.rb
mongo_mapper-0.7.3 lib/mongo_mapper/plugins/equality.rb
numon-0.0.1 lib/mongo_mapper/plugins/equality.rb
mongo_mapper-0.7.2 lib/mongo_mapper/plugins/equality.rb
mongo_mapper-0.7.1 lib/mongo_mapper/plugins/equality.rb
mongo_mapper-unstable-2010.3.8 lib/mongo_mapper/plugins/equality.rb
mongo_mapper-unstable-2010.3.5 lib/mongo_mapper/plugins/equality.rb
mongo_mapper-unstable-2010.3.4 lib/mongo_mapper/plugins/equality.rb
mongo_mapper-unstable-2010.3.3 lib/mongo_mapper/plugins/equality.rb
drogus-mongo_mapper-0.6.10 lib/mongo_mapper/plugins/equality.rb
mongo_mapper-unstable-2010.2.28 lib/mongo_mapper/plugins/equality.rb
mongo_mapper-unstable-2010.2.27 lib/mongo_mapper/plugins/equality.rb
mongo_mapper-unstable-2010.2.26 lib/mongo_mapper/plugins/equality.rb
mongo_mapper-unstable-2010.2.25 lib/mongo_mapper/plugins/equality.rb
mongo_mapper-unstable-2010.2.24 lib/mongo_mapper/plugins/equality.rb
mongo_mapper-unstable-2010.2.23 lib/mongo_mapper/plugins/equality.rb
mongo_mapper-unstable-2010.2.22 lib/mongo_mapper/plugins/equality.rb
mongo_mapper-unstable-2010.2.19 lib/mongo_mapper/plugins/equality.rb