Exception: JSONAPI::Exceptions::ParameterMissing
- Defined in:
- lib/jsonapi/exceptions.rb
Instance Attribute Summary collapse
-
#param ⇒ Object
Returns the value of attribute param.
Attributes inherited from Error
Instance Method Summary collapse
- #errors ⇒ Object
-
#initialize(param, error_object_overrides = {}) ⇒ ParameterMissing
constructor
A new instance of ParameterMissing.
Methods inherited from Error
Constructor Details
#initialize(param, error_object_overrides = {}) ⇒ ParameterMissing
Returns a new instance of ParameterMissing.
411 412 413 414 |
# File 'lib/jsonapi/exceptions.rb', line 411 def initialize(param, error_object_overrides = {}) @param = param super(error_object_overrides) end |
Instance Attribute Details
#param ⇒ Object
Returns the value of attribute param.
409 410 411 |
# File 'lib/jsonapi/exceptions.rb', line 409 def param @param end |
Instance Method Details
#errors ⇒ Object
416 417 418 419 420 421 422 423 |
# File 'lib/jsonapi/exceptions.rb', line 416 def errors [create_error_object(code: JSONAPI::PARAM_MISSING, status: :bad_request, title: I18n.translate('jsonapi-resources.exceptions.parameter_missing.title', default: 'Missing Parameter'), detail: I18n.translate('jsonapi-resources.exceptions.parameter_missing.detail', default: "The required parameter, #{param}, is missing.", param: param))] end |