Exception: CmdParse::ParseError
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- CmdParse::ParseError
- Defined in:
- lib/module_cmdparse/cmdparse.rb
Overview
Base class for all cmdparse errors.
Direct Known Subclasses
InvalidArgumentError, InvalidCommandError, InvalidOptionError, NoCommandGivenError, TakesNoCommandError
Instance Attribute Summary collapse
-
#actualCmd ⇒ Object
Returns the value of attribute actualCmd.
Class Method Summary collapse
-
.reason(reason, has_arguments = true) ⇒ Object
Sets the reason for a subclass.
Instance Method Summary collapse
-
#message ⇒ Object
Returns the reason plus the message.
Instance Attribute Details
#actualCmd ⇒ Object
Returns the value of attribute actualCmd.
34 35 36 |
# File 'lib/module_cmdparse/cmdparse.rb', line 34 def actualCmd @actualCmd end |
Class Method Details
.reason(reason, has_arguments = true) ⇒ Object
Sets the reason for a subclass.
37 38 39 |
# File 'lib/module_cmdparse/cmdparse.rb', line 37 def self.reason( reason, has_arguments = true ) (@@reason ||= {})[self] = [reason, has_arguments] end |
Instance Method Details
#message ⇒ Object
Returns the reason plus the message.
42 43 44 45 46 |
# File 'lib/module_cmdparse/cmdparse.rb', line 42 def data = @@reason[self.class] || ['Unknown error', true] @cmdname = super data[0] + (data[1] ? ": " + super : '') end |