Exception: JSONAPI::Exceptions::PageParametersNotAllowed

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ PageParametersNotAllowed

Returns a new instance of PageParametersNotAllowed.



329
330
331
# File 'lib/jsonapi/exceptions.rb', line 329

def initialize(params)
  @params = params
end

Instance Attribute Details

#paramsObject

Returns the value of attribute params.



328
329
330
# File 'lib/jsonapi/exceptions.rb', line 328

def params
  @params
end

Instance Method Details

#errorsObject



333
334
335
336
337
338
339
340
341
# File 'lib/jsonapi/exceptions.rb', line 333

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

end