Exception: JSONAPI::Exceptions::InvalidSortParam
- Defined in:
- lib/jsonapi/exceptions.rb
Instance Attribute Summary collapse
-
#resource ⇒ Object
Returns the value of attribute resource.
-
#sort_param ⇒ Object
Returns the value of attribute sort_param.
Instance Method Summary collapse
- #errors ⇒ Object
-
#initialize(resource, sort_param) ⇒ InvalidSortParam
constructor
A new instance of InvalidSortParam.
Constructor Details
#initialize(resource, sort_param) ⇒ InvalidSortParam
Returns a new instance of InvalidSortParam.
135 136 137 138 |
# File 'lib/jsonapi/exceptions.rb', line 135 def initialize(resource, sort_param) @resource = resource @sort_param = sort_param end |
Instance Attribute Details
#resource ⇒ Object
Returns the value of attribute resource.
134 135 136 |
# File 'lib/jsonapi/exceptions.rb', line 134 def resource @resource end |
#sort_param ⇒ Object
Returns the value of attribute sort_param.
134 135 136 |
# File 'lib/jsonapi/exceptions.rb', line 134 def sort_param @sort_param end |
Instance Method Details
#errors ⇒ Object
140 141 142 143 144 145 |
# File 'lib/jsonapi/exceptions.rb', line 140 def errors [JSONAPI::Error.new(code: JSONAPI::INVALID_SORT_PARAM, status: :bad_request, title: 'Invalid sort param', detail: "#{sort_param} is not a valid sort param for #{resource}")] end |