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.



31
32
33
34
# File 'lib/neo4j-embedded/embedded_node.rb', line 31

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

Instance Method Details

#each(&block) ⇒ Object



40
41
42
# File 'lib/neo4j-embedded/embedded_node.rb', line 40

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

#empty?Boolean

Returns:

  • (Boolean)


45
46
47
# File 'lib/neo4j-embedded/embedded_node.rb', line 45

def empty?
  first.nil?
end

#inspectObject



36
37
38
# File 'lib/neo4j-embedded/embedded_node.rb', line 36

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