Exception: JSONAPI::Exceptions::InvalidSortFormat
- Defined in:
- lib/jsonapi/exceptions.rb
Instance Attribute Summary collapse
-
#resource ⇒ Object
Returns the value of attribute resource.
-
#sort_criteria ⇒ Object
Returns the value of attribute sort_criteria.
Instance Method Summary collapse
- #errors ⇒ Object
-
#initialize(resource, sort_criteria) ⇒ InvalidSortFormat
constructor
A new instance of InvalidSortFormat.
Constructor Details
#initialize(resource, sort_criteria) ⇒ InvalidSortFormat
Returns a new instance of InvalidSortFormat.
180 181 182 183 |
# File 'lib/jsonapi/exceptions.rb', line 180 def initialize(resource, sort_criteria) @resource = resource @sort_criteria = sort_criteria end |
Instance Attribute Details
#resource ⇒ Object
Returns the value of attribute resource.
179 180 181 |
# File 'lib/jsonapi/exceptions.rb', line 179 def resource @resource end |
#sort_criteria ⇒ Object
Returns the value of attribute sort_criteria.
179 180 181 |
# File 'lib/jsonapi/exceptions.rb', line 179 def sort_criteria @sort_criteria end |
Instance Method Details
#errors ⇒ Object
185 186 187 188 189 190 |
# File 'lib/jsonapi/exceptions.rb', line 185 def errors [JSONAPI::Error.new(code: JSONAPI::INVALID_SORT_FORMAT, status: :bad_request, title: 'Invalid sort format', detail: "#{sort_criteria} must start with a direction (+ or -)")] end |