Class: PBM::Commands::Help
- Inherits:
-
Object
- Object
- PBM::Commands::Help
- Defined in:
- lib/pbm/commands/help.rb
Instance Method Summary collapse
- #description ⇒ Object
-
#initialize(interpreter) ⇒ Help
constructor
A new instance of Help.
- #run ⇒ Object
Constructor Details
#initialize(interpreter) ⇒ Help
4 5 6 |
# File 'lib/pbm/commands/help.rb', line 4 def initialize(interpreter) @interpreter = interpreter end |
Instance Method Details
#description ⇒ Object
8 9 10 |
# File 'lib/pbm/commands/help.rb', line 8 def description 'help - displays this help' end |
#run ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/pbm/commands/help.rb', line 12 def run "\n List of commands:\n -----------------\n\n \#{@interpreter.commands.values.map(&:description).sort.join(\"\\n\")}\n\n HELP\nend\n".gsub(/^ {10}/, '') |