Class: TTY::Option::InvalidArgument
- Inherits:
-
ParseError
- Object
- ParseError
- TTY::Option::InvalidArgument
- Defined in:
- lib/tty/option/errors.rb
Overview
Raised when parameter argument doesn’t match expected value
Constant Summary collapse
- MESSAGE =
"value of `%<value>s` fails validation for '%<name>s' %<type>s"
Instance Attribute Summary
Attributes inherited from ParseError
Instance Method Summary collapse
-
#initialize(param_or_message, value = nil) ⇒ InvalidArgument
constructor
A new instance of InvalidArgument.
Methods inherited from ParseError
Constructor Details
#initialize(param_or_message, value = nil) ⇒ InvalidArgument
Returns a new instance of InvalidArgument.
53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/tty/option/errors.rb', line 53 def initialize(, value = nil) if .is_a?(Parameter) @param = = format(MESSAGE, value: format_value(value), name: param.name, type: param.to_sym) else = end super() end |