Class: Predicator::Visitors::Each
- Defined in:
- lib/predicator/visitors/each.rb
Constant Summary
Constants inherited from Visitor
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
Returns the value of attribute block.
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/predicator/visitors/each.rb', line 6 def initialize block @block = block end |
Instance Attribute Details
#block ⇒ Object (readonly)
Returns the value of attribute block.
4 5 6 |
# File 'lib/predicator/visitors/each.rb', line 4 def block @block end |
Instance Method Details
#visit(node) ⇒ Object
10 11 12 13 |
# File 'lib/predicator/visitors/each.rb', line 10 def visit node super block.call node end |