Method: Neo4j::ActiveNode::Query::QueryProxyEnumerable#each_rel

Defined in:
lib/neo4j/active_node/query/query_proxy_enumerable.rb

#each_rel(&block) ⇒ Enumerable

When called at the end of a QueryProxy chain, it will return the resultant relationship objects intead of nodes. For example, to return the relationship between a given student and their lessons:

.. code-block

ruby

student.lessons.each_rel do |rel|

Returns:

  • (Enumerable)

    An enumerable containing any number of applicable relationship objects.



54
55
56
# File 'lib/neo4j/active_node/query/query_proxy_enumerable.rb', line 54

def each_rel(&block)
  block_given? ? each(false, true, &block) : to_enum(:each, false, true)
end