Exception: Acter::InvalidCommand
- Defined in:
- lib/acter/error.rb
Direct Known Subclasses
HelpWanted, InvalidAction, InvalidSubject, MissingParameters
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#schema ⇒ Object
readonly
Returns the value of attribute schema.
-
#subject ⇒ Object
readonly
Returns the value of attribute subject.
Instance Method Summary collapse
-
#initialize(schema, subject = nil, action = nil, params = nil) ⇒ InvalidCommand
constructor
A new instance of InvalidCommand.
- #to_s ⇒ Object
Constructor Details
#initialize(schema, subject = nil, action = nil, params = nil) ⇒ InvalidCommand
Returns a new instance of InvalidCommand.
23 24 25 26 27 28 |
# File 'lib/acter/error.rb', line 23 def initialize(schema, subject = nil, action = nil, params = nil) @schema = schema @subject = subject @action = action @params = params end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
29 30 31 |
# File 'lib/acter/error.rb', line 29 def action @action end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
29 30 31 |
# File 'lib/acter/error.rb', line 29 def params @params end |
#schema ⇒ Object (readonly)
Returns the value of attribute schema.
29 30 31 |
# File 'lib/acter/error.rb', line 29 def schema @schema end |
#subject ⇒ Object (readonly)
Returns the value of attribute subject.
29 30 31 |
# File 'lib/acter/error.rb', line 29 def subject @subject end |
Instance Method Details
#to_s ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/acter/error.rb', line 30 def to_s if @schema.nil? "Command-line help" else "Invalid command" end end |