Class: Cuprum::Rails::Errors::InvalidParameters

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

Overview

Error class when a parameters hash does not match the expected contract.

Constant Summary collapse

TYPE =

Short string used to identify the type of error.

'cuprum.rails.errors.invalid_parameters'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(errors:) ⇒ InvalidParameters

Returns a new instance of InvalidParameters.

Parameters:

  • errors (Stannum::Errors)

    the errors returned by the contract.



14
15
16
17
18
# File 'lib/cuprum/rails/errors/invalid_parameters.rb', line 14

def initialize(errors:)
  @errors = errors

  super(message: default_message, errors: errors)
end

Instance Attribute Details

#errorsStannum::Errors (readonly)

Returns the errors returned by the contract.

Returns:

  • (Stannum::Errors)

    the errors returned by the contract.



21
22
23
# File 'lib/cuprum/rails/errors/invalid_parameters.rb', line 21

def errors
  @errors
end