Class: Neo4j::Embedded::NodesIterator

Inherits:
Object
  • Object
show all
Extended by:
Core::TxMethods
Includes:
Enumerable
Defined in:
lib/neo4j-embedded/embedded_node.rb

Instance Method Summary collapse

Methods included from Core::TxMethods

tx_methods

Constructor Details

#initialize(node, match) ⇒ NodesIterator

Returns a new instance of NodesIterator.



33
34
35
36
# File 'lib/neo4j-embedded/embedded_node.rb', line 33

def initialize(node, match)
  @node = node
  @match = match
end

Instance Method Details

#each(&block) ⇒ Object



42
43
44
# File 'lib/neo4j-embedded/embedded_node.rb', line 42

def each(&block)
  @node._rels(@match).each { |r| block.call(r.other_node(@node)) }
end

#empty?Boolean

Returns:

  • (Boolean)


47
48
49
# File 'lib/neo4j-embedded/embedded_node.rb', line 47

def empty?
  first.nil?
end

#inspectObject



38
39
40
# File 'lib/neo4j-embedded/embedded_node.rb', line 38

def inspect
  'Enumerable<Neo4j::Node>'
end