Exception: Cl::UnknownOption
Constant Summary
Constants inherited from Error
Instance Attribute Summary collapse
-
#cmd ⇒ Object
readonly
Returns the value of attribute cmd.
-
#opt ⇒ Object
readonly
Returns the value of attribute opt.
Instance Method Summary collapse
-
#initialize(cmd, str) ⇒ UnknownOption
constructor
A new instance of UnknownOption.
- #suggestions ⇒ Object
Constructor Details
#initialize(cmd, str) ⇒ UnknownOption
Returns a new instance of UnknownOption.
45 46 47 48 49 |
# File 'lib/cl/errors.rb', line 45 def initialize(cmd, str) @cmd = cmd @opt = str.sub('invalid option: ', '') super(:unknown_option, opt) end |
Instance Attribute Details
#cmd ⇒ Object (readonly)
Returns the value of attribute cmd.
43 44 45 |
# File 'lib/cl/errors.rb', line 43 def cmd @cmd end |
#opt ⇒ Object (readonly)
Returns the value of attribute opt.
43 44 45 |
# File 'lib/cl/errors.rb', line 43 def opt @opt end |
Instance Method Details
#suggestions ⇒ Object
51 52 53 |
# File 'lib/cl/errors.rb', line 51 def suggestions cmd.suggestions(opt) end |