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
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Command
commands, find, format_subcmd, format_subcmds, help, inherited, #initialize, load_commands, #match
Class Method Details
.description ⇒ Object
146
147
148
|
# File 'lib/byebug/commands/variables.rb', line 146
def description
%{v[ar] l[ocal]\t\t\tshow local variables}
end
|
.names ⇒ Object
142
143
144
|
# File 'lib/byebug/commands/variables.rb', line 142
def names
%w(var)
end
|
Instance Method Details
#execute ⇒ Object
133
134
135
136
137
138
139
|
# File 'lib/byebug/commands/variables.rb', line 133
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
129
130
131
|
# File 'lib/byebug/commands/variables.rb', line 129
def regexp
/^\s* v(?:ar)? \s+ l(?:ocal)? \s*$/x
end
|