Module: Debugger::VarFunctions

Included in:
VarConstantCommand, VarGlobalCommand, VarInstanceCommand, VarLocalCommand
Defined in:
lib/ruby-debug/commands/variables.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#var_consts(mod) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/ruby-debug/commands/variables.rb', line 16

def var_consts(mod)
  constants = mod.constants
  constants.sort!
  for c in constants
    print " %s => %s\n", c, mod.const_get(c)
  end
end

#var_list(ary, b = get_binding) ⇒ Object



3
4
5
6
7
8
# File 'lib/ruby-debug/commands/variables.rb', line 3

def var_list(ary, b = get_binding)
  ary.sort!
  for v in ary
    print "  %s => %s\n", v, debug_eval(v, b).inspect
  end
end

#var_locals(locals) ⇒ Object



10
11
12
13
14
# File 'lib/ruby-debug/commands/variables.rb', line 10

def var_locals(locals)
  locals.keys.sort.each do |name|
    print "  %s => %s\n", name, locals[name]
  end
end