Sha256: 66fae77fd7b4a3eeecba5ed6e63ae88fbff7a20460673fd42f48393099d726dc

Contents?: true

Size: 377 Bytes

Versions: 6

Compression:

Stored size: 377 Bytes

Contents

# encoding: UTF-8
module MarkMapper
  module Plugins
    module Equality
      extend ActiveSupport::Concern

      module ClassMethods
        def ===(other)
          other.is_a?(self)
        end
      end

      def eql?(other)
        other.is_a?(self.class) && _id == other._id
      end
      alias :== :eql?

      def hash
        _id.hash
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
mark_mapper-0.0.6 lib/mark_mapper/plugins/equality.rb
mark_mapper-0.0.5 lib/mark_mapper/plugins/equality.rb
mark_mapper-0.0.4 lib/mark_mapper/plugins/equality.rb
mark_mapper-0.0.3 lib/mark_mapper/plugins/equality.rb
mark_mapper-0.0.2 lib/mark_mapper/plugins/equality.rb
mark_mapper-0.0.1 lib/mark_mapper/plugins/equality.rb