Sha256: 2e50cc9870055de2c9786fa796a2395267b7d2f72f4700426655d97bbd99da66
Contents?: true
Size: 571 Bytes
Versions: 112
Compression:
Stored size: 571 Bytes
Contents
module Neo4j::Shared module Identity def ==(other) other.class == self.class && other.id == id end alias_method :eql?, :== # Returns an Enumerable of all (primary) key attributes # or nil if model.persisted? is false def to_key _persisted_obj ? [id] : nil end # @return [Integer, nil] the neo4j id of the node if persisted or nil def neo_id _persisted_obj ? _persisted_obj.neo_id : nil end def id id = neo_id id.is_a?(Integer) ? id : nil end def hash id.hash end end end
Version data entries
112 entries across 112 versions & 2 rubygems