Class: Byebug::VarLocalCommand
- Inherits:
-
Command
- Object
- Command
- Byebug::VarLocalCommand
show all
- Defined in:
- lib/byebug/commands/variables.rb
Overview
Implements byebug’s ‘var local’ command
Constant Summary
Constants inherited
from Command
Command::DEF_OPTIONS
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Command
commands, #find, #format_subcmds, inherited, #initialize, load_commands, #match, method_missing, options, register_setting_get, register_setting_set, register_setting_var, settings, settings_map
Class Method Details
.help(cmd) ⇒ Object
153
154
155
156
157
|
# File 'lib/byebug/commands/variables.rb', line 153
def help(cmd)
%{
v[ar] l[ocal]\t\t\tshow local variables
}
end
|
.help_command ⇒ Object
149
150
151
|
# File 'lib/byebug/commands/variables.rb', line 149
def help_command
'var'
end
|
Instance Method Details
#execute ⇒ Object
140
141
142
143
144
145
146
|
# File 'lib/byebug/commands/variables.rb', line 140
def execute
locals = @state.context.frame_locals(@state.frame_pos)
_self = @state.context.frame_self(@state.frame_pos)
locals.keys.sort.each do |name|
print " %s => %p\n", name, locals[name]
end
end
|
#regexp ⇒ Object
136
137
138
|
# File 'lib/byebug/commands/variables.rb', line 136
def regexp
/^\s*v(?:ar)?\s+l(?:ocal)?\s*$/
end
|