Module: Neo4j::Wrapper::RelationshipMixin::Initialize
- Included in:
- RelationshipMixin
- Defined in:
- lib/neo4j-wrapper/relationship_mixin/initialize.rb
Instance Method Summary collapse
- #_java_rel ⇒ Object (also: #_java_entity)
-
#init_on_create(rel_type, from_node, to_node, *props) ⇒ Object
Creates a new node and initialize with given properties.
-
#init_on_load(java_rel) ⇒ Object
Init this node with the specified java neo4j relationship.
Instance Method Details
#_java_rel ⇒ Object Also known as: _java_entity
25 26 27 |
# File 'lib/neo4j-wrapper/relationship_mixin/initialize.rb', line 25 def _java_rel @_java_rel end |
#init_on_create(rel_type, from_node, to_node, *props) ⇒ Object
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 |
#init_on_load(java_rel) ⇒ Object
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 |