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
Returns a new instance of 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 <<-HELP.gsub(/^ {10}/, '') List of commands: ----------------- #{@interpreter.commands.values.map(&:description).sort.join("\n")} HELP end |