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/zombie_killer/variable_scope.rb, line 11
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/zombie_killer/variable_scope.rb, line 27
def [](varname)
  super
end
[]=(varname, state) click to toggle source

Set state for a variable

Calls superclass method
# File lib/zombie_killer/variable_scope.rb, line 32
def []=(varname, state)
  super
end
dup() click to toggle source

Deep copy the VariableState values

# File lib/zombie_killer/variable_scope.rb, line 18
def dup
  copy = self.class.new
  each do |k, v|
    copy[k] = v.dup
  end
  copy
end