Module: Quickl::Command::Delegator::ClassMethods
- Defined in:
- lib/quickl/command/delegator.rb
Instance Method Summary collapse
Instance Method Details
#summarized_subcommands ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/quickl/command/delegator.rb', line 25 def summarized_subcommands doc = subcommands.collect{|cmd| [cmd.command_name, cmd.overview] } max = doc.inject(0){|memo,pair| l = pair.first.length memo > l ? memo : l } doc.collect{|pair| " %-#{max}s %s" % pair }.join("\n") end |