Exception: Acclaim::Option::Parser::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Acclaim::Option::Parser::Error
- Defined in:
- lib/acclaim/option/parser/error.rb
Overview
Errors raised by the parser.
Class Method Summary collapse
-
.raise_missing_required(option) ⇒ Object
Raises an Error with the following error message:.
-
.raise_multiple(option) ⇒ Object
Raises an error with the following error message:.
-
.raise_wrong_arg_number(actual, minimum, optional) ⇒ Object
Raises an Error with the following error message:.
Class Method Details
.raise_missing_required(option) ⇒ Object
Raises an Error with the following error message:
Missing required argument (#{option.names.join '|'})
18 19 20 21 |
# File 'lib/acclaim/option/parser/error.rb', line 18 def self.raise_missing_required(option) names = option.names.join '|' raise self, "Missing required argument (#{names})" end |
.raise_multiple(option) ⇒ Object
Raises an error with the following error message:
Multiple instances of [#{options.names.join ''}] encountered
26 27 28 29 |
# File 'lib/acclaim/option/parser/error.rb', line 26 def self.raise_multiple(option) names = option.names.join '|' raise self, "Multiple instances of [#{names}] encountered" end |
.raise_wrong_arg_number(actual, minimum, optional) ⇒ Object
Raises an Error with the following error message:
Wrong number of arguments (#{actual} for #{minimum})
11 12 13 |
# File 'lib/acclaim/option/parser/error.rb', line 11 def self.raise_wrong_arg_number(actual, minimum, optional) raise self, "Wrong number of arguments (#{actual} for #{minimum})" end |