Exception: Tools::InvalidCommandException

Inherits:
StandardError
  • Object
show all
Defined in:
lib/tools/support/exceptions.rb

Instance Method Summary collapse

Constructor Details

#initialize(command, available_commands) ⇒ InvalidCommandException

InvalidCommandException indicates to the user that the specified command is not supported.

Parameters:

  • command (Symbol)

    The command that the user passed to this program.

  • available_commands (Array)

    The commands that they are able to pass to this program.



6
7
8
9
# File 'lib/tools/support/exceptions.rb', line 6

def initialize(command, available_commands)
  @command = command
  @available_commands = available_commands
end

Instance Method Details

#messageObject



11
12
13
# File 'lib/tools/support/exceptions.rb', line 11

def message
  %(Invalid command "#{@command}". Available commands: #{available_commands_string}.)
end