Class: Jinx::Visitor::VisitorEnumerator
- Includes:
- Enumerable
- Defined in:
- lib/jinx/helpers/visitor.rb
Instance Method Summary collapse
- #each {|node| ... } ⇒ Object
-
#initialize(visitor, node) ⇒ VisitorEnumerator
constructor
A new instance of VisitorEnumerator.
Methods included from Enumerable
#enumerate, #pp_s, #pretty_print, #pretty_print_cycle, #qp, #to_enum, #transitive_closure
Constructor Details
#initialize(visitor, node) ⇒ VisitorEnumerator
Returns a new instance of VisitorEnumerator.
296 297 298 299 |
# File 'lib/jinx/helpers/visitor.rb', line 296 def initialize(visitor, node) @visitor = visitor @root = node end |
Instance Method Details
#each {|node| ... } ⇒ Object
303 304 305 |
# File 'lib/jinx/helpers/visitor.rb', line 303 def each @visitor.visit(@root) { |node| yield(node) } end |