Module: Byebug::VarFunctions
- Defined in:
- lib/byebug/commands/variables.rb
Instance Method Summary collapse
Instance Method Details
#var_class_self ⇒ Object
21 22 23 24 |
# File 'lib/byebug/commands/variables.rb', line 21 def var_class_self obj = bb_eval('self') var_list(obj.class.class_variables, get_binding) end |
#var_global ⇒ Object
26 27 28 |
# File 'lib/byebug/commands/variables.rb', line 26 def var_global var_list(global_variables.reject { |v| [:$=, :$KCODE, :$-K].include?(v) }) end |
#var_list(ary, b = get_binding) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/byebug/commands/variables.rb', line 3 def var_list(ary, b = get_binding) ary.sort! for v in ary begin s = bb_eval(v.to_s, b).inspect rescue begin s = bb_eval(v.to_s, b).to_s rescue s = "*Error in evaluation*" end end s = "#{v} = #{s}" s[Setting[:width]-3..-1] = "..." if s.size > Setting[:width] print "#{s}\n" end end |