Class: Byebug::VarInheritCommand
- Inherits:
-
Command
- Object
- Command
- Byebug::VarInheritCommand
show all
- Defined in:
- lib/byebug/commands/variables.rb
Overview
Implements byebug’s ‘var inherit’ command
Constant Summary
Constants inherited
from Command
Command::DEF_OPTIONS
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Command
commands, format_subcmd, format_subcmds, help, inherited, #initialize, load_commands, #match, method_missing, options, register_setting_get, register_setting_set, register_setting_var, settings, settings_map
Class Method Details
.description ⇒ Object
193
194
195
196
197
|
# File 'lib/byebug/commands/variables.rb', line 193
def description
%{
v[ar] ct\t\t\tshow class heirarchy of object
}
end
|
.names ⇒ Object
189
190
191
|
# File 'lib/byebug/commands/variables.rb', line 189
def names
%w(var)
end
|
Instance Method Details
#execute ⇒ Object
174
175
176
177
178
179
180
181
182
183
184
185
186
|
# File 'lib/byebug/commands/variables.rb', line 174
def execute
unless @state.context
errmsg "can't get object inheritance.\n"
return
end
puts @match.post_match
obj = debug_eval("#{@match.post_match}.classtree")
if obj
print obj
else
errmsg "Trouble getting object #{@match.post_match}\n"
end
end
|
#regexp ⇒ Object
170
171
172
|
# File 'lib/byebug/commands/variables.rb', line 170
def regexp
/^\s*v(?:ar)?\s+ct\s*/
end
|