Class: Byebug::AddDisplayCommand

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

Constant Summary

Constants inherited from Command

Command::DEF_OPTIONS

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Command

commands, #find, inherited, #initialize, load_commands, #match, method_missing, options, #print_subcmds, register_setting_get, register_setting_set, register_setting_var, settings, settings_map

Constructor Details

This class inherits a constructor from Byebug::Command

Class Method Details

.help(cmd) ⇒ Object



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

def help(cmd)
  %{
    disp[lay] <expression>\tadd expression into display expression list
  }
end

.help_commandObject



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

def help_command
  'display'
end

Instance Method Details

#executeObject



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

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

#regexpObject



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

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