Exception: Acter::InvalidSubject

Inherits:
InvalidCommand show all
Defined in:
lib/acter/error.rb

Instance Attribute Summary

Attributes inherited from InvalidCommand

#action, #params, #schema, #subject

Instance Method Summary collapse

Constructor Details

#initialize(subject, schema) ⇒ InvalidSubject

Returns a new instance of InvalidSubject.



40
41
42
# File 'lib/acter/error.rb', line 40

def initialize(subject, schema)
  super(schema, subject)
end

Instance Method Details

#messageObject



43
44
45
# File 'lib/acter/error.rb', line 43

def message
  "Invalid subject"
end

#to_sObject



46
47
48
49
50
51
52
# File 'lib/acter/error.rb', line 46

def to_s
  if @subject.nil? || @subject == "help"
    "Command-line help"
  else
    "#{message}: #{@subject.inspect}"
  end
end