Module: Neo4j::Core::Node

Included in:
Node
Defined in:
lib/neo4j-core/node/node.rb,
lib/neo4j-core/node/class_methods.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary (collapse)

Instance Method Details

- (Object) _java_node

This method can be used to access the none wrapped neo4j node/relationship java object. Notice that this method is defined in the Java::OrgNeo4jKernel::impl.core.NodeProxy or RelationshipProxy which is return by Neo4j::Node.new

Returns:

  • the java node/relationship object representing this object unless it is already the java object.



24
25
26
# File 'lib/neo4j-core/node/node.rb', line 24

def _java_node
  self
end

- (Object) class

Overrides the class so that the java object feels like a Ruby object.



35
36
37
# File 'lib/neo4j-core/node/node.rb', line 35

def class
  Neo4j::Node
end

- (Object) del

Delete the node and all its relationship.

It might raise an exception if this method was called without a Transaction, or if it failed to delete the node (it maybe was already deleted).

If this method raise an exception you may also get an exception when the transaction finish. This method is defined in the Java::OrgNeo4jKernel::impl.core.NodeProxy which is return by Neo4j::Node.new

Returns:

  • nil or raise an exception



15
16
17
18
19
# File 'lib/neo4j-core/node/node.rb', line 15

def del
  _rels.each { |r| r.del }
  delete
  nil
end

- (true, false) exist?

Same as Neo4j::Node#exist? or Neo4j::Relationship#exist?

Returns:

  • (true, false)

    if the node exists in the database



30
31
32
# File 'lib/neo4j-core/node/node.rb', line 30

def exist?
  Neo4j::Node.exist?(self)
end