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.



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

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

Instance Method Details

#each(&block) ⇒ Object



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

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

#empty?Boolean

Returns:

  • (Boolean)


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

def empty?
  first.nil?
end

#inspectObject



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

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