Class: Byebug::VarInstanceCommand
- Inherits:
-
Command
- Object
- Command
- Byebug::VarInstanceCommand
show all
- Defined in:
- lib/byebug/commands/variables.rb
Constant Summary
Constants inherited
from Command
Command::DEF_OPTIONS
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Command
commands, #find, inherited, #initialize, load_commands, #match, method_missing, options, #print_subcmds, register_setting_get, register_setting_set, register_setting_var, settings, settings_map
Class Method Details
.help(cmd) ⇒ Object
126
127
128
129
130
|
# File 'lib/byebug/commands/variables.rb', line 126
def help(cmd)
%{
v[ar] i[nstance] <object>\tshow instance variables of object
}
end
|
.help_command ⇒ Object
122
123
124
|
# File 'lib/byebug/commands/variables.rb', line 122
def help_command
'var'
end
|
Instance Method Details
#execute ⇒ Object
116
117
118
119
|
# File 'lib/byebug/commands/variables.rb', line 116
def execute
obj = debug_eval(@match.post_match.empty? ? 'self' : @match.post_match)
var_list(obj.instance_variables, obj.instance_eval{binding()})
end
|
#regexp ⇒ Object
112
113
114
|
# File 'lib/byebug/commands/variables.rb', line 112
def regexp
/^\s*v(?:ar)?\s+ins(?:tance)?\s*/
end
|