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 11 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 19 def each @commands.each { |cmd| yield(cmd) } end
match(input)
click to toggle source
# File lib/byebug/command_list.rb, line 15 def match(input) find { |cmd| cmd.match(input) } end
to_s()
click to toggle source
# File lib/byebug/command_list.rb, line 23 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 29 def width @width ||= map(&:to_s).max_by(&:size).size end