Exception: JSONAPI::Exceptions::ParametersNotAllowed
- Defined in:
- lib/jsonapi/exceptions.rb
Instance Attribute Summary collapse
-
#params ⇒ Object
Returns the value of attribute params.
Instance Method Summary collapse
- #errors ⇒ Object
-
#initialize(params) ⇒ ParametersNotAllowed
constructor
A new instance of ParametersNotAllowed.
Constructor Details
#initialize(params) ⇒ ParametersNotAllowed
Returns a new instance of ParametersNotAllowed.
207 208 209 |
# File 'lib/jsonapi/exceptions.rb', line 207 def initialize(params) @params = params end |
Instance Attribute Details
#params ⇒ Object
Returns the value of attribute params.
206 207 208 |
# File 'lib/jsonapi/exceptions.rb', line 206 def params @params end |
Instance Method Details
#errors ⇒ Object
211 212 213 214 215 216 217 218 219 |
# File 'lib/jsonapi/exceptions.rb', line 211 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 |