Class: Neo4j::Embedded::RelsIterator
- Inherits:
-
Object
- Object
- Neo4j::Embedded::RelsIterator
- Extended by:
- Core::TxMethods
- Includes:
- Enumerable
- Defined in:
- lib/neo4j-embedded/embedded_node.rb
Constant Summary collapse
- MARSHAL_INSTANCE_VARIABLES =
[:@node, :@match]
Instance Method Summary collapse
- #each(&block) ⇒ Object
- #empty? ⇒ Boolean
-
#initialize(node, match) ⇒ RelsIterator
constructor
A new instance of RelsIterator.
- #inspect ⇒ Object
Methods included from Core::TxMethods
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
#each(&block) ⇒ Object
19 20 21 |
# File 'lib/neo4j-embedded/embedded_node.rb', line 19 def each(&block) @node._rels(@match).each { |r| block.call(r.wrapper) } end |
#empty? ⇒ Boolean
24 25 26 |
# File 'lib/neo4j-embedded/embedded_node.rb', line 24 def empty? first.nil? end |
#inspect ⇒ Object
15 16 17 |
# File 'lib/neo4j-embedded/embedded_node.rb', line 15 def inspect 'Enumerable<Neo4j::Relationship>' end |