Module: Neo4j::Wrapper::RelationshipMixin::Initialize

Included in:
RelationshipMixin
Defined in:
lib/neo4j-wrapper/relationship_mixin/initialize.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) _java_rel Also known as: _java_entity



25
26
27
# File 'lib/neo4j-wrapper/relationship_mixin/initialize.rb', line 25

def _java_rel
  @_java_rel
end

- (Object) init_on_create(rel_type, from_node, to_node, *props)

Creates a new node and initialize with given properties. You can override this to provide your own initialization.



16
17
18
19
20
21
# File 'lib/neo4j-wrapper/relationship_mixin/initialize.rb', line 16

def init_on_create(rel_type, from_node, to_node, *props) # :nodoc:
  _java_entity[:_classname] = self.class.to_s
  if props.first.respond_to?(:each_pair)
    props.first.each_pair { |k, v| respond_to?("#{k}=") ? self.send("#{k}=", v) : @_java_rel[k] = v }
  end
end

- (Object) init_on_load(java_rel)

Init this node with the specified java neo4j relationship.



7
8
9
# File 'lib/neo4j-wrapper/relationship_mixin/initialize.rb', line 7

def init_on_load(java_rel)
  @_java_rel = java_rel
end