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
command_exists?, commands, find, 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, terminal_width
Class Method Details
.description ⇒ Object
145
146
147
|
# File 'lib/byebug/commands/variables.rb', line 145
def description
%{v[ar] l[ocal]\t\t\tshow local variables}
end
|
.names ⇒ Object
141
142
143
|
# File 'lib/byebug/commands/variables.rb', line 141
def names
%w(var)
end
|
Instance Method Details
#execute ⇒ Object
132
133
134
135
136
137
138
|
# File 'lib/byebug/commands/variables.rb', line 132
def execute
_self = @state.context.frame_self(@state.frame_pos)
locals = @state.context.frame_locals
locals.keys.sort.each do |name|
print " %s => %p\n", name, locals[name]
end
end
|
#regexp ⇒ Object
128
129
130
|
# File 'lib/byebug/commands/variables.rb', line 128
def regexp
/^\s*v(?:ar)?\s+l(?:ocal)?\s*$/
end
|