Class: Byebug::AddDisplayCommand

Inherits:
Command
  • Object
show all
Defined in:
lib/byebug/commands/display.rb

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, register_setting_get, register_setting_set, register_setting_var, settings, settings_map, terminal_width

Constructor Details

This class inherits a constructor from Byebug::Command

Class Method Details

.descriptionObject



43
44
45
# File 'lib/byebug/commands/display.rb', line 43

def description
  %{disp[lay] <expression>\tadd expression into display expression list}
end

.namesObject



39
40
41
# File 'lib/byebug/commands/display.rb', line 39

def names
  %w(display)
end

Instance Method Details

#executeObject



31
32
33
34
35
36
# File 'lib/byebug/commands/display.rb', line 31

def execute
  exp = @match[1]
  @state.display.push [true, exp]
  print "#{@state.display.size}: "
  display_expression(exp)
end

#regexpObject



27
28
29
# File 'lib/byebug/commands/display.rb', line 27

def regexp
  /^\s* disp(?:lay)? \s+ (.+) \s*$/x
end