Class: GDA::Visitors::Each
Instance Method Summary collapse
-
#initialize(block) ⇒ Each
constructor
A new instance of Each.
- #visit(node) ⇒ Object
Methods inherited from Visitor
Constructor Details
#initialize(block) ⇒ Each
Returns a new instance of Each.
6 7 8 |
# File 'lib/gda/visitors/each.rb', line 6 def initialize block @block = block end |
Instance Method Details
#visit(node) ⇒ Object
10 11 12 13 14 15 |
# File 'lib/gda/visitors/each.rb', line 10 def visit node super unless node.nil? || Array === node @block.call node end end |