Sha256: 38f73522ae03170b068e30cac9169bd0224ee925d764fcee2190d9485fcb5f1e
Contents?: true
Size: 471 Bytes
Versions: 5
Compression:
Stored size: 471 Bytes
Contents
require "enumerator" class Ppl::Application::CommandSuite include Enumerable def initialize @commands = [] end def add_command(command) @commands.push command end def each @commands.each { |command| yield command } end def find_command(name) @commands.select { |command| command.name == name }.first end def sort_by_name @commands.sort! { |a, b| a.name <=> b.name } end def [](index) @commands[index] end end
Version data entries
5 entries across 5 versions & 1 rubygems