Class: Neo4j::Embedded::RelsIterator

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

Constant Summary collapse

MARSHAL_INSTANCE_VARIABLES =
%i[@node @match]

Instance Method Summary collapse

Methods included from Core::TxMethods

tx_methods

Constructor Details

#initialize(node, match) ⇒ RelsIterator

Returns a new instance of RelsIterator.



9
10
11
12
13
# File 'lib/neo4j-embedded/embedded_node.rb', line 9

def initialize(node, match)
  @node = node
  ::Neo4j::Node.validate_match!(match)
  @match = match
end

Instance Method Details

#eachObject



19
20
21
# File 'lib/neo4j-embedded/embedded_node.rb', line 19

def each
  @node._rels(@match).each { |r| yield(r.wrapper) }
end

#empty?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/neo4j-embedded/embedded_node.rb', line 24

def empty?
  first.nil?
end

#inspectObject



15
16
17
# File 'lib/neo4j-embedded/embedded_node.rb', line 15

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