Class: Journey::Visitors::Each

Inherits:
Visitor
  • Object
show all
Defined in:
lib/journey/visitors.rb

Overview

Loop through the requirements AST

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Visitor

#accept

Constructor Details

#initialize(block) ⇒ Each

Returns a new instance of Each.



42
43
44
# File 'lib/journey/visitors.rb', line 42

def initialize block
  @block = block
end

Instance Attribute Details

#blockObject (readonly)

:nodoc:



40
41
42
# File 'lib/journey/visitors.rb', line 40

def block
  @block
end

Instance Method Details

#visit(node) ⇒ Object



46
47
48
49
# File 'lib/journey/visitors.rb', line 46

def visit node
  super
  block.call node
end