Sha256: f312517cb5978836fb9c58ce218fb505802bb6312376156e83bea0b4c263b128

Contents?: true

Size: 840 Bytes

Versions: 24

Compression:

Stored size: 840 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_property_manager.convert_properties_to(self, :ruby, @attributes)
    end

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

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
neo4j-5.2.15 lib/neo4j/shared/initialize.rb
neo4j-5.2.14 lib/neo4j/shared/initialize.rb
neo4j-5.2.13 lib/neo4j/shared/initialize.rb
neo4j-5.2.12 lib/neo4j/shared/initialize.rb
neo4j-5.2.11 lib/neo4j/shared/initialize.rb
neo4j-5.2.10 lib/neo4j/shared/initialize.rb
neo4j-5.2.9 lib/neo4j/shared/initialize.rb
neo4j-5.2.8 lib/neo4j/shared/initialize.rb
neo4j-5.2.7 lib/neo4j/shared/initialize.rb
neo4j-5.2.6 lib/neo4j/shared/initialize.rb
neo4j-5.2.5 lib/neo4j/shared/initialize.rb
neo4j-5.2.3 lib/neo4j/shared/initialize.rb
neo4j-5.2.2 lib/neo4j/shared/initialize.rb
neo4j-5.2.1 lib/neo4j/shared/initialize.rb
neo4j-5.2.0 lib/neo4j/shared/initialize.rb
neo4j-5.1.5 lib/neo4j/shared/initialize.rb
neo4j-5.1.4 lib/neo4j/shared/initialize.rb
neo4j-5.1.3 lib/neo4j/shared/initialize.rb
neo4j-5.1.2 lib/neo4j/shared/initialize.rb
neo4j-5.1.1 lib/neo4j/shared/initialize.rb