Class: Cuprum::Errors::CommandNotImplemented

Inherits:
Cuprum::Error show all
Defined in:
lib/cuprum/errors/command_not_implemented.rb

Overview

Error returned when a Command is called without defining a #process method.

Constant Summary collapse

TYPE =

Short string used to identify the type of error.

'cuprum.errors.command_not_implemented'

Instance Attribute Summary collapse

Attributes inherited from Cuprum::Error

#message, #type

Instance Method Summary collapse

Methods inherited from Cuprum::Error

#==, #as_json

Constructor Details

#initialize(command:) ⇒ CommandNotImplemented

Returns a new instance of CommandNotImplemented.

Parameters:



19
20
21
22
23
24
25
26
# File 'lib/cuprum/errors/command_not_implemented.rb', line 19

def initialize(command:)
  @command = command

  class_name = command&.class&.name || 'command'
  message    = MESSAGE_FORMAT % class_name

  super(command: command, message: message)
end

Instance Attribute Details

#commandCuprum::Command (readonly)

Returns The command called without a definition.

Returns:



29
30
31
# File 'lib/cuprum/errors/command_not_implemented.rb', line 29

def command
  @command
end