class Byebug::CommandList - byebug-11.0.1 Documentation

# class Byebug::CommandList

Holds an array of subcommands for a command

### Public Class Methods

new(commands) click to toggle source

    # File lib/byebug/command_list.rb, line 12
    def initialize(commands)
      @commands = commands.sort_by(&:to_s)
    end

### Public Instance Methods

each() { |cmd| ... } click to toggle source

    # File lib/byebug/command_list.rb, line 20
    def each
      @commands.each { |cmd| yield(cmd) }
    end

match(input) click to toggle source

    # File lib/byebug/command_list.rb, line 16
    def match(input)
      find { |cmd| cmd.match(input) }
    end

to_s() click to toggle source

    # File lib/byebug/command_list.rb, line 24
    def to_s
      "\n" + map { |cmd| cmd.columnize(width) }.join + "\n"
    end

### Private Instance Methods

width() click to toggle source

    # File lib/byebug/command_list.rb, line 30
    def width
      @width ||= map(&:to_s).max_by(&:size).size
    end