Pelle

in method :apa, all variables turn to ‘pelle’

trace = TracePoint.new(:call) {|tp|
  vars = eval "local_variables", tp.binding
  if tp.callee_id == :apa
    vars.map { eval "#{it}='pelle'", tp.binding }
  end
}

trace.enable

def apa(name, age)
  [name.upcase, age]
end



p apa 'olle', 12 # => ["PELLE", "pelle"]