Class: Neo4j::Node

Inherits:
Object
  • Object
show all
Extended by:
Core::Node::ClassMethods, Core::Wrapper::ClassMethods
Includes:
Core::Equal, Core::Node, Core::Property, Core::Rels, Core::Traversal, Core::Wrapper
Defined in:
lib/neo4j/node.rb

Overview

A node in the graph with properties and relationships to other entities. Along with relationships, nodes are the core building blocks of the Neo4j data representation model. Node has three major groups of operations: operations that deal with relationships, operations that deal with properties and operations that traverse the node space. The property operations give access to the key-value property pairs. Property keys are always strings. Valid property value types are the primitives (String, Fixnum, Float, Boolean), and arrays of those primitives.

The Neo4j::Node#new method does not return a new Ruby instance (!). Instead it will call the Neo4j Java API which will return a org.neo4j.kernel.impl.core.NodeProxy object. This java object includes the same mixin as this class. The #class method on the java object returns Neo4j::Node in order to make it feel like an ordinary Ruby object.

Class Method Summary collapse

Methods included from Core::Node::ClassMethods

_load, exist?, load, new

Methods included from Core::Wrapper::ClassMethods

wrapper, wrapper_proc=

Methods included from Core::Wrapper

#wrapper

Methods included from Core::Node

#_java_node, #class, #del, #exist?

Methods included from Core::Equal

#==, #eql?, #equal?

Methods included from Core::Traversal

#both, #eval_paths, #expand, #incoming, #outgoing, #unique

Methods included from Core::ToJava

dir_from_java, dir_to_java, type_to_java, types_to_java

Methods included from Core::Rels

#_node, #_nodes, #_rel, #_rels, #node, #nodes, #rel, #rel?, #rels

Methods included from Core::Property

#[], #[]=, #neo_id, #property?, #props, #update

Class Method Details

.extend_java_class(java_clazz) ⇒ Object

This method is used to extend a Java Neo4j class so that it includes the same mixins as this class.



27
28
29
30
31
32
33
34
35
36
# File 'lib/neo4j/node.rb', line 27

def extend_java_class(java_clazz)
  java_clazz.class_eval do
    include Neo4j::Core::Property
    include Neo4j::Core::Rels
    include Neo4j::Core::Traversal
    include Neo4j::Core::Equal
    include Neo4j::Core::Node
    include Neo4j::Core::Wrapper
  end
end