module Neo4j::Shared::Initialize

Public Instance Methods

wrapper() click to toggle source

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

   # File lib/neo4j/shared/initialize.rb
 8 def wrapper
 9   self
10 end

Private Instance Methods

convert_and_assign_attributes(properties) click to toggle source
   # File lib/neo4j/shared/initialize.rb
14 def convert_and_assign_attributes(properties)
15   @attributes ||= Hash[self.class.attributes_nil_hash]
16   stringify_attributes!(@attributes, properties)
17   self.default_properties = properties if respond_to?(:default_properties=)
18   self.class.declared_properties.convert_properties_to(self, :ruby, @attributes)
19 end
stringify_attributes!(attr, properties) click to toggle source
   # File lib/neo4j/shared/initialize.rb
21 def stringify_attributes!(attr, properties)
22   properties.each_pair do |k, v|
23     key = self.class.declared_properties.string_key(k)
24     attr[key.freeze] = v
25   end
26 end