Exception: JSONAPI::Exceptions::ParametersNotAllowed

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ ParametersNotAllowed

Returns a new instance of ParametersNotAllowed.



207
208
209
# File 'lib/jsonapi/exceptions.rb', line 207

def initialize(params)
  @params = params
end

Instance Attribute Details

#paramsObject

Returns the value of attribute params.



206
207
208
# File 'lib/jsonapi/exceptions.rb', line 206

def params
  @params
end

Instance Method Details

#errorsObject



211
212
213
214
215
216
217
218
219
# File 'lib/jsonapi/exceptions.rb', line 211

def errors
      params.collect { |param|
        JSONAPI::Error.new(code: JSONAPI::PARAM_NOT_ALLOWED,
                       status: :bad_request,
                       title: 'Param not allowed',
                       detail: "#{param} is not allowed.")
      }

end