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.



303
304
305
# File 'lib/jsonapi/exceptions.rb', line 303

def initialize(params)
  @params = params
end

Instance Attribute Details

#paramsObject

Returns the value of attribute params.



302
303
304
# File 'lib/jsonapi/exceptions.rb', line 302

def params
  @params
end

Instance Method Details

#errorsObject



307
308
309
310
311
312
313
314
315
# File 'lib/jsonapi/exceptions.rb', line 307

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