Class: Cuprum::Collections::Errors::InvalidParameters

Inherits:
Error
  • Object
show all
Defined in:
lib/cuprum/collections/errors/invalid_parameters.rb

Overview

An error returned when a command is called with invalid parameters.

Constant Summary collapse

TYPE =

Short string used to identify the type of error.

'cuprum.collections.errors.invalid_parameters'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(command:, errors:) ⇒ InvalidParameters

Returns a new instance of InvalidParameters.

Parameters:

  • command (Cuprum::Command)

    the called command.

  • errors (Stannum::Errors)

    the errors returned by the parameters contract.



16
17
18
19
20
21
22
23
24
25
# File 'lib/cuprum/collections/errors/invalid_parameters.rb', line 16

def initialize(command:, errors:)
  @command = command
  @errors  = errors

  super(
    command: command,
    errors:  errors,
    message: "invalid parameters for command #{command.class}"
  )
end

Instance Attribute Details

#commandCuprum::Command (readonly)

Returns the called command.

Returns:

  • (Cuprum::Command)

    the called command.



28
29
30
# File 'lib/cuprum/collections/errors/invalid_parameters.rb', line 28

def command
  @command
end

#errorsStannum::Errors (readonly)

Returns the errors returned by the parameters contract.

Returns:

  • (Stannum::Errors)

    the errors returned by the parameters contract.



31
32
33
# File 'lib/cuprum/collections/errors/invalid_parameters.rb', line 31

def errors
  @errors
end