Exception: FunWithJsonApi::Exceptions::RelationshipMethodNotSupported
- Inherits:
-
FunWithJsonApi::Exception
- Object
- StandardError
- FunWithJsonApi::Exception
- FunWithJsonApi::Exceptions::RelationshipMethodNotSupported
- Defined in:
- lib/fun_with_json_api/exceptions/relationship_method_not_supported.rb
Constant Summary collapse
- EXCEPTION_CODE =
'collection_method_not_supported'.freeze
Instance Attribute Summary
Attributes inherited from FunWithJsonApi::Exception
Instance Method Summary collapse
-
#initialize(message, payload = ExceptionPayload.new) ⇒ RelationshipMethodNotSupported
constructor
A new instance of RelationshipMethodNotSupported.
Methods inherited from FunWithJsonApi::Exception
Constructor Details
#initialize(message, payload = ExceptionPayload.new) ⇒ RelationshipMethodNotSupported
Returns a new instance of RelationshipMethodNotSupported.
6 7 8 9 10 11 12 13 |
# File 'lib/fun_with_json_api/exceptions/relationship_method_not_supported.rb', line 6 def initialize(, payload = ExceptionPayload.new) payload = Array.wrap(payload).each do |unsupported| unsupported.code ||= EXCEPTION_CODE unsupported.title ||= I18n.t(EXCEPTION_CODE, scope: 'fun_with_json_api.exceptions') unsupported.status ||= '403' end super end |