Class: Arel::Nodes::Node

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/activerecord-arel_depth_first/nodes/node.rb

Instance Method Summary collapse

Instance Method Details

#each(&block) ⇒ Object

Iterate through AST, nodes will be yielded depth-first



9
10
11
12
13
# File 'lib/activerecord-arel_depth_first/nodes/node.rb', line 9

def each(&block)
  return enum_for(:each) unless block_given?

  ::Arel::Visitors::DepthFirst.new(block).accept self
end