class Byebug::InfoCommand::DisplayCommand - byebug-9.0.6 Documentation

# class Byebug::InfoCommand::DisplayCommand

Information about display expressions

### Public Class Methods

description() click to toggle source

    # File lib/byebug/commands/info/display.rb, line 16
    def self.description
      <<-EOD
        inf[o] d[display]

        #{short_description}
      EOD
    end

regexp() click to toggle source

    # File lib/byebug/commands/info/display.rb, line 12
    def self.regexp
      /^\s* d(?:isplay)? \s*$/x
    end

short_description() click to toggle source

    # File lib/byebug/commands/info/display.rb, line 24
    def self.short_description
      'List of expressions to display when program stops'
    end

### Public Instance Methods

execute() click to toggle source

    # File lib/byebug/commands/info/display.rb, line 28
    def execute
      unless Byebug.displays.find { |d| d[0] }
        return puts('There are no auto-display expressions now.')
      end

      puts 'Auto-display expressions now in effect:'
      puts 'Num Enb Expression'

      Byebug.displays.each_with_index do |d, i|
        puts(format('%3d: %s  %s', i + 1, d[0] ? 'y' : 'n', d[1]))
      end
    end