class Ppl::Application::CommandSuite
Public Class Methods
new()
click to toggle source
# File lib/ppl/application/command_suite.rb, line 7 def initialize @commands = [] end
Public Instance Methods
[](index)
click to toggle source
# File lib/ppl/application/command_suite.rb, line 27 def [](index) @commands[index] end
add_command(command)
click to toggle source
# File lib/ppl/application/command_suite.rb, line 11 def add_command(command) @commands.push command end
each() { |command| ... }
click to toggle source
# File lib/ppl/application/command_suite.rb, line 15 def each @commands.each { |command| yield command } end
find_command(name)
click to toggle source
# File lib/ppl/application/command_suite.rb, line 19 def find_command(name) @commands.select { |command| command.name == name }.first end
sort_by_name()
click to toggle source
# File lib/ppl/application/command_suite.rb, line 23 def sort_by_name @commands.sort! { |a, b| a.name <=> b.name } end