Exception: MotherBrain::CommandNotFound

Inherits:
MBError
  • Object
show all
Defined in:
lib/mb/errors.rb

Constant Summary

Constants inherited from MBError

MBError::DEFAULT_EXIT_CODE

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from MBError

#error_code, error_code, exit_code, #exit_code, #to_hash, #to_json, #to_s

Constructor Details

#initialize(name, parent) ⇒ CommandNotFound

Returns a new instance of CommandNotFound.

Parameters:

  • name (String)

    name of the command that was not found

  • parent (MB::Plugin, MB::Component)

    plugin that we searched for the command on



278
279
280
281
# File 'lib/mb/errors.rb', line 278

def initialize(name, parent)
  @name   = name
  @parent = parent
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



271
272
273
# File 'lib/mb/errors.rb', line 271

def name
  @name
end

#parentObject (readonly)

Returns the value of attribute parent.



272
273
274
# File 'lib/mb/errors.rb', line 272

def parent
  @parent
end

Instance Method Details

#messageObject



283
284
285
# File 'lib/mb/errors.rb', line 283

def message
  "#{parent.class} '#{parent}' does not have the command: '#{name}'"
end