Exception: JSONAPI::Exceptions::InvalidInclude
- Defined in:
- lib/jsonapi/exceptions.rb
Instance Attribute Summary collapse
-
#association ⇒ Object
Returns the value of attribute association.
-
#resource ⇒ Object
Returns the value of attribute resource.
Instance Method Summary collapse
- #errors ⇒ Object
-
#initialize(resource, association) ⇒ InvalidInclude
constructor
A new instance of InvalidInclude.
Constructor Details
#initialize(resource, association) ⇒ InvalidInclude
Returns a new instance of InvalidInclude.
177 178 179 180 |
# File 'lib/jsonapi/exceptions.rb', line 177 def initialize(resource, association) @resource = resource @association = association end |
Instance Attribute Details
#association ⇒ Object
Returns the value of attribute association.
176 177 178 |
# File 'lib/jsonapi/exceptions.rb', line 176 def association @association end |
#resource ⇒ Object
Returns the value of attribute resource.
176 177 178 |
# File 'lib/jsonapi/exceptions.rb', line 176 def resource @resource end |
Instance Method Details
#errors ⇒ Object
182 183 184 185 186 187 |
# File 'lib/jsonapi/exceptions.rb', line 182 def errors [JSONAPI::Error.new(code: JSONAPI::INVALID_INCLUDE, status: :bad_request, title: 'Invalid field', detail: "#{association} is not a valid association of #{resource}")] end |