Class: HelpCommand
- Inherits:
-
Object
- Object
- HelpCommand
- Defined in:
- lib/commands/help_command.rb
Instance Method Summary collapse
- #accepts_shell_command?(command) ⇒ Boolean
- #continue_test_loop? ⇒ Boolean
- #execute_from_shell(params) ⇒ Object
- #help(command = nil) ⇒ Object
-
#initialize(view) ⇒ HelpCommand
constructor
A new instance of HelpCommand.
Constructor Details
#initialize(view) ⇒ HelpCommand
Returns a new instance of HelpCommand.
3 4 5 |
# File 'lib/commands/help_command.rb', line 3 def initialize view @view = view end |
Instance Method Details
#accepts_shell_command?(command) ⇒ Boolean
19 20 21 |
# File 'lib/commands/help_command.rb', line 19 def accepts_shell_command? command ['help', '-h', '--help'].member? command end |
#continue_test_loop? ⇒ Boolean
23 24 25 |
# File 'lib/commands/help_command.rb', line 23 def continue_test_loop? false end |
#execute_from_shell(params) ⇒ Object
7 8 9 |
# File 'lib/commands/help_command.rb', line 7 def execute_from_shell params help params[1] end |
#help(command = nil) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/commands/help_command.rb', line 11 def help command=nil if command then @view.show_detailed_help command.downcase else @view.show_help end end |