Class: Opal::Rewriters::ForRewriter::LocalVariableAssigns

Inherits:
Base
  • Object
show all
Defined in:
opal/lib/opal/rewriters/for_rewriter.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#append_to_body, #prepend_to_body, #s, s

Constructor Details

#initializeLocalVariableAssigns

Returns a new instance of LocalVariableAssigns



81
82
83
# File 'opal/lib/opal/rewriters/for_rewriter.rb', line 81

def initialize
  @result = Set.new
end

Instance Attribute Details

#resultObject (readonly)

Returns the value of attribute result



73
74
75
# File 'opal/lib/opal/rewriters/for_rewriter.rb', line 73

def result
  @result
end

Class Method Details

.find(node) ⇒ Object



75
76
77
78
79
# File 'opal/lib/opal/rewriters/for_rewriter.rb', line 75

def self.find(node)
  processor = new
  processor.process(node)
  processor.result.to_a
end

Instance Method Details

#on_lvasgn(node) ⇒ Object



85
86
87
88
89
# File 'opal/lib/opal/rewriters/for_rewriter.rb', line 85

def on_lvasgn(node)
  name, _ = *node
  self.result << name
  super
end