Class: Unparser::AST::LocalVariableScopeEnumerator
- Inherits:
-
Object
- Object
- Unparser::AST::LocalVariableScopeEnumerator
- Includes:
- Enumerable
- Defined in:
- lib/unparser/ast/local_variable_scope.rb
Overview
Local variable scope enumerator
Class Method Summary collapse
-
.each(node, &block) ⇒ self
private
Enumerate each node with its local variable scope.
Instance Method Summary collapse
-
#each(node, &block) ⇒ self, Enumerator<Array<Symbol>>
private
Enumerate local variable scope scope.
-
#initialize ⇒ undefined
constructor
private
Initialize object.
Constructor Details
#initialize ⇒ undefined
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Initialize object
119 120 121 |
# File 'lib/unparser/ast/local_variable_scope.rb', line 119 def initialize @stack = [Set.new] end |
Class Method Details
.each(node, &block) ⇒ self
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Enumerate each node with its local variable scope
131 132 133 134 |
# File 'lib/unparser/ast/local_variable_scope.rb', line 131 def self.each(node, &block) new.each(node, &block) self end |
Instance Method Details
#each(node, &block) ⇒ self, Enumerator<Array<Symbol>>
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Enumerate local variable scope scope
146 147 148 149 |
# File 'lib/unparser/ast/local_variable_scope.rb', line 146 def each(node, &block) return to_enum(__method__, node) unless block_given? visit(node, &block) end |