class Convoy::Formatter::Commands

Attributes

context[R]
setup[R]

Public Class Methods

command_for(setup, context) click to toggle source
# File lib/convoy/formatter/commands.rb, line 7
def command_for(setup, context)
    if context.empty?
        GlobalCommand.new(setup)
    else
        Command.new(context.last, setup, context)
    end
end
new(setup, context) click to toggle source
# File lib/convoy/formatter/commands.rb, line 18
def initialize(setup, context)
    @setup   = setup
    @context = context
end

Public Instance Methods

count() click to toggle source
# File lib/convoy/formatter/commands.rb, line 30
def count
    setup.canonical_command_names_for(context).size
end
Also aliased as: size
each(&block) click to toggle source
# File lib/convoy/formatter/commands.rb, line 23
def each(&block)
    setup.canonical_command_names_for(context).each do |command_name|
        command = Command.new(command_name, setup, context)
        block.call(command)
    end
end
size()
Alias for: count