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.



150
151
152
# File 'lib/jsonapi/exceptions.rb', line 150

def initialize(params)
  @params = params
end

Instance Attribute Details

#paramsObject

Returns the value of attribute params.



149
150
151
# File 'lib/jsonapi/exceptions.rb', line 149

def params
  @params
end

Instance Method Details

#errorsObject



154
155
156
157
158
159
160
161
162
# File 'lib/jsonapi/exceptions.rb', line 154

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