class VariableScope
Tracks state for local variables visible at certain point. Keys are symbols, values are VariableState
Public Class Methods
new()
click to toggle source
Calls superclass method
# File lib/rubocop/yast/variable_scope.rb, line 18 def initialize super do |hash, key| hash[key] = VariableState.new end end
Public Instance Methods
[](varname)
click to toggle source
@return [VariableState] state
Calls superclass method
# File lib/rubocop/yast/variable_scope.rb, line 34 def [](varname) v = super RuboCop::Yast.logger.debug "GET #{varname} -> #{v}" v end
[]=(varname, state)
click to toggle source
Set state for a variable
Calls superclass method
# File lib/rubocop/yast/variable_scope.rb, line 41 def []=(varname, state) RuboCop::Yast.logger.debug "SET #{varname} -> #{state}" super end
dup()
click to toggle source
Deep copy the VariableState
values
# File lib/rubocop/yast/variable_scope.rb, line 25 def dup copy = self.class.new each do |k, v| copy[k] = v.dup end copy end