Exception: JSONAPI::Exceptions::ParameterNotAllowed

Inherits:
Error
  • Object
show all
Defined in:
lib/jsonapi/exceptions.rb

Instance Attribute Summary collapse

Attributes inherited from Error

#error_object_overrides

Instance Method Summary collapse

Methods inherited from Error

#create_error_object

Constructor Details

#initialize(param, error_object_overrides = {}) ⇒ ParameterNotAllowed

Returns a new instance of ParameterNotAllowed.



395
396
397
398
# File 'lib/jsonapi/exceptions.rb', line 395

def initialize(param, error_object_overrides = {})
  @param = param
  super(error_object_overrides)
end

Instance Attribute Details

#paramObject

Returns the value of attribute param.



393
394
395
# File 'lib/jsonapi/exceptions.rb', line 393

def param
  @param
end

Instance Method Details

#errorsObject



400
401
402
403
404
405
406
407
# File 'lib/jsonapi/exceptions.rb', line 400

def errors
  [create_error_object(code: JSONAPI::PARAM_NOT_ALLOWED,
                      status: :bad_request,
                      title: I18n.translate('jsonapi-resources.exceptions.parameter_not_allowed.title',
                                            default: 'Param not allowed'),
                      detail: I18n.translate('jsonapi-resources.exceptions.parameters_not_allowed.detail',
                                             default: "#{param} is not allowed.", param: param))]
end