Exception: JSONAPI::Exceptions::InvalidInclude
- Defined in:
- lib/jsonapi/exceptions.rb
Instance Attribute Summary collapse
-
#relationship ⇒ Object
Returns the value of attribute relationship.
-
#resource ⇒ Object
Returns the value of attribute resource.
Instance Method Summary collapse
- #errors ⇒ Object
-
#initialize(resource, relationship) ⇒ InvalidInclude
constructor
A new instance of InvalidInclude.
Constructor Details
#initialize(resource, relationship) ⇒ InvalidInclude
Returns a new instance of InvalidInclude.
192 193 194 195 |
# File 'lib/jsonapi/exceptions.rb', line 192 def initialize(resource, relationship) @resource = resource @relationship = relationship end |
Instance Attribute Details
#relationship ⇒ Object
Returns the value of attribute relationship.
191 192 193 |
# File 'lib/jsonapi/exceptions.rb', line 191 def relationship @relationship end |
#resource ⇒ Object
Returns the value of attribute resource.
191 192 193 |
# File 'lib/jsonapi/exceptions.rb', line 191 def resource @resource end |
Instance Method Details
#errors ⇒ Object
197 198 199 200 201 202 |
# File 'lib/jsonapi/exceptions.rb', line 197 def errors [JSONAPI::Error.new(code: JSONAPI::INVALID_INCLUDE, status: :bad_request, title: 'Invalid field', detail: "#{relationship} is not a valid relationship of #{resource}")] end |