Module: Neo4j::Node::Wrapper
- Defined in:
- lib/neo4j/active_node/node_wrapper.rb
Overview
The wrapping process is what transforms a raw CypherNode or EmbeddedNode from Neo4j::Core into a healthy ActiveNode (or ActiveRel) object.
Instance Method Summary collapse
- #class_to_wrap ⇒ Object
-
#wrapper ⇒ Object
this is a plugin in the neo4j-core so that the Ruby wrapper will be wrapped around the Neo4j::Node objects.
Instance Method Details
#class_to_wrap ⇒ Object
16 17 18 19 20 21 |
# File 'lib/neo4j/active_node/node_wrapper.rb', line 16 def class_to_wrap load_classes_from_labels Neo4j::ActiveNode::Labels.model_for_labels(labels).tap do |model_class| Neo4j::Node::Wrapper.populate_constants_for_labels_cache(model_class, labels) end end |
#wrapper ⇒ Object
this is a plugin in the neo4j-core so that the Ruby wrapper will be wrapped around the Neo4j::Node objects
7 8 9 10 11 12 13 14 |
# File 'lib/neo4j/active_node/node_wrapper.rb', line 7 def wrapper found_class = class_to_wrap return self if not found_class found_class.new.tap do |wrapped_node| wrapped_node.init_on_load(self, self.props) end end |