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.



355
356
357
# File 'lib/jsonapi/exceptions.rb', line 355

def initialize(params)
  @params = params
end

Instance Attribute Details

#paramsObject

Returns the value of attribute params.



354
355
356
# File 'lib/jsonapi/exceptions.rb', line 354

def params
  @params
end

Instance Method Details

#errorsObject



359
360
361
362
363
364
365
366
# File 'lib/jsonapi/exceptions.rb', line 359

def errors
  params.collect do |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
end