Class: Opal::Rewriters::ForRewriter::LocalVariableAssigns
- Inherits:
-
Base
- Object
- Parser::AST::Processor
- Base
- Opal::Rewriters::ForRewriter::LocalVariableAssigns
- Defined in:
- lib/opal/rewriters/for_rewriter.rb
Overview
rubocop:enable Layout/MultilineMethodCallBraceLayout,Layout/MultilineArrayBraceLayout
Constant Summary
Constants inherited from Base
Instance Attribute Summary collapse
-
#result ⇒ Object
readonly
Returns the value of attribute result.
Attributes inherited from Base
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ LocalVariableAssigns
constructor
A new instance of LocalVariableAssigns.
- #on_lvasgn(node) ⇒ Object
Methods inherited from Base
#append_to_body, #begin_with_stmts, #dynamic!, #error, #on_top, #prepend_to_body, #process, s, #s, #stmts_of
Constructor Details
#initialize ⇒ LocalVariableAssigns
Returns a new instance of LocalVariableAssigns.
93 94 95 |
# File 'lib/opal/rewriters/for_rewriter.rb', line 93 def initialize @result = Set.new end |
Instance Attribute Details
#result ⇒ Object (readonly)
Returns the value of attribute result.
85 86 87 |
# File 'lib/opal/rewriters/for_rewriter.rb', line 85 def result @result end |
Class Method Details
.find(node) ⇒ Object
87 88 89 90 91 |
# File 'lib/opal/rewriters/for_rewriter.rb', line 87 def self.find(node) processor = new processor.process(node) processor.result.to_a end |
Instance Method Details
#on_lvasgn(node) ⇒ Object
97 98 99 100 101 |
# File 'lib/opal/rewriters/for_rewriter.rb', line 97 def on_lvasgn(node) name, _ = *node result << name super end |