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.



316
317
318
# File 'lib/jsonapi/exceptions.rb', line 316

def initialize(params)
  @params = params
end

Instance Attribute Details

#paramsObject

Returns the value of attribute params.



315
316
317
# File 'lib/jsonapi/exceptions.rb', line 315

def params
  @params
end

Instance Method Details

#errorsObject



320
321
322
323
324
325
326
327
328
# File 'lib/jsonapi/exceptions.rb', line 320

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