Class: Cuprum::Rails::Errors::MissingParameter
- Inherits:
-
Error
- Object
- Error
- Cuprum::Rails::Errors::MissingParameter
- Defined in:
- lib/cuprum/rails/errors/missing_parameter.rb
Overview
Error class when a parameters hash does not include the expected keys.
Constant Summary collapse
- TYPE =
Short string used to identify the type of error.
'cuprum.rails.errors.missing_parameter'
Instance Attribute Summary collapse
-
#parameter_name ⇒ String, Symbol
readonly
The name of the missing parameter.
-
#parameters ⇒ Hash
readonly
The received parameters.
Instance Method Summary collapse
-
#initialize(parameter_name:, parameters:) ⇒ MissingParameter
constructor
A new instance of MissingParameter.
Constructor Details
#initialize(parameter_name:, parameters:) ⇒ MissingParameter
Returns a new instance of MissingParameter.
13 14 15 16 17 18 19 20 21 |
# File 'lib/cuprum/rails/errors/missing_parameter.rb', line 13 def initialize(parameter_name:, parameters:) @parameter_name = parameter_name @parameters = parameters super( message: , parameter_name: parameter_name ) end |
Instance Attribute Details
#parameter_name ⇒ String, Symbol (readonly)
Returns the name of the missing parameter.
24 25 26 |
# File 'lib/cuprum/rails/errors/missing_parameter.rb', line 24 def parameter_name @parameter_name end |
#parameters ⇒ Hash (readonly)
Returns the received parameters.
27 28 29 |
# File 'lib/cuprum/rails/errors/missing_parameter.rb', line 27 def parameters @parameters end |