class Cuprum::Errors::CommandNotImplemented

Error class to be used when a Command is called without defining a process method.

Constants

COMPARABLE_PROPERTIES
MESSAGE_FORMAT

Format for generating error message.

TYPE

Short string used to identify the type of error.

Attributes

command[R]

@return [Cuprum::Command] The command called without a definition.

Public Class Methods

new(command:) click to toggle source

@param command [Cuprum::Command] The command called without a definition.

Calls superclass method Cuprum::Error::new
# File lib/cuprum/errors/command_not_implemented.rb, line 20
def initialize(command:)
  @command = command

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

  super(command: command, message: message)
end

Private Instance Methods

as_json_data() click to toggle source
# File lib/cuprum/errors/command_not_implemented.rb, line 34
def as_json_data
  command ? { 'class_name' => command.class.name } : {}
end