Exception: Acter::InvalidCommand

Inherits:
Error
  • Object
show all
Defined in:
lib/acter/error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#actionObject (readonly)

Returns the value of attribute action.



29
30
31
# File 'lib/acter/error.rb', line 29

def action
  @action
end

#paramsObject (readonly)

Returns the value of attribute params.



29
30
31
# File 'lib/acter/error.rb', line 29

def params
  @params
end

#schemaObject (readonly)

Returns the value of attribute schema.



29
30
31
# File 'lib/acter/error.rb', line 29

def schema
  @schema
end

#subjectObject (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_sObject



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