Sha256: b00b0286ff89d728ebe8d536ca39ef4bbc121567fd272ba7da55440908e71c38

Contents?: true

Size: 828 Bytes

Versions: 142

Compression:

Stored size: 828 Bytes

Contents

module Neo4j::Shared
  module Initialize
    extend ActiveSupport::Concern

    # Implements the Neo4j::Node#wrapper and Neo4j::Relationship#wrapper method
    # so that we don't have to care if the node is wrapped or not.
    # @return self
    def wrapper
      self
    end

    private

    def convert_and_assign_attributes(properties)
      @attributes ||= Hash[self.class.attributes_nil_hash]
      stringify_attributes!(@attributes, properties)
      self.default_properties = properties if respond_to?(:default_properties=)
      self.class.declared_properties.convert_properties_to(self, :ruby, @attributes)
    end

    def stringify_attributes!(attr, properties)
      properties.each_pair do |k, v|
        key = self.class.declared_properties.string_key(k)
        attr[key.freeze] = v
      end
    end
  end
end

Version data entries

142 entries across 142 versions & 2 rubygems

Version Path
neo4j-9.2.1 lib/neo4j/shared/initialize.rb
neo4j-9.2.0 lib/neo4j/shared/initialize.rb
neo4j-9.1.8 lib/neo4j/shared/initialize.rb
neo4j-9.1.7 lib/neo4j/shared/initialize.rb
neo4j-9.1.6 lib/neo4j/shared/initialize.rb
neo4j-9.1.5 lib/neo4j/shared/initialize.rb
neo4j-9.1.4 lib/neo4j/shared/initialize.rb
neo4j-9.1.3 lib/neo4j/shared/initialize.rb
neo4j-9.1.2 lib/neo4j/shared/initialize.rb
neo4j-9.1.1 lib/neo4j/shared/initialize.rb
neo4j-9.1.0 lib/neo4j/shared/initialize.rb
neo4j-9.0.7 lib/neo4j/shared/initialize.rb
neo4j-9.0.6 lib/neo4j/shared/initialize.rb
neo4j-9.0.5 lib/neo4j/shared/initialize.rb
neo4j-8.3.4 lib/neo4j/shared/initialize.rb
neo4j-9.0.4 lib/neo4j/shared/initialize.rb
neo4j-8.3.3 lib/neo4j/shared/initialize.rb
neo4j-9.0.3 lib/neo4j/shared/initialize.rb
neo4j-8.3.2 lib/neo4j/shared/initialize.rb
neo4j-9.0.2 lib/neo4j/shared/initialize.rb