class Byebug::DisplayCommand - byebug-4.0.5 Documentation

# class Byebug::DisplayCommand

Displays the value of enabled expressions.

### Public Class Methods

always_run() click to toggle source

    # File lib/byebug/commands/display.rb, line 51
    def self.always_run
      2
    end

description() click to toggle source

    # File lib/byebug/commands/display.rb, line 68
    def description
      prettify <<-EOD
        disp[lay] Display expression list.
      EOD
    end

names() click to toggle source

    # File lib/byebug/commands/display.rb, line 64
    def names
      %w(display)
    end

### Public Instance Methods

execute() click to toggle source

    # File lib/byebug/commands/display.rb, line 59
    def execute
      print_display_expressions
    end

regexp() click to toggle source

    # File lib/byebug/commands/display.rb, line 55
    def regexp
      /^\s* disp(?:lay)? \s*$/x
    end

### Private Instance Methods

print_display_expressions() click to toggle source

    # File lib/byebug/commands/display.rb, line 77
    def print_display_expressions
      result = prc('display.result', @state.display) do |item, index|
        is_active, expression = item
        if is_active
          { n: index + 1,
            exp: expression,
            result: bb_warning_eval(expression).inspect }
        end
      end
      print result
    end