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



295
296
297
298
# File 'lib/mb/errors.rb', line 295

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

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



288
289
290
# File 'lib/mb/errors.rb', line 288

def name
  @name
end

#parentObject (readonly)

Returns the value of attribute parent.



289
290
291
# File 'lib/mb/errors.rb', line 289

def parent
  @parent
end

Instance Method Details

#messageObject



300
301
302
# File 'lib/mb/errors.rb', line 300

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