Class: JSONAPI::Request::QueryParamCollection::SortParam
- Inherits:
-
QueryParam
- Object
- Item
- NameValuePair
- QueryParam
- JSONAPI::Request::QueryParamCollection::SortParam
- Defined in:
- lib/easy/jsonapi/request/query_param_collection/sort_param.rb
Overview
Used to create a unique Sort JSONAPI::Request::QueryParamCollection::QueryParam
Instance Attribute Summary
Attributes inherited from Item
Instance Method Summary collapse
-
#initialize(res_field_arr) ⇒ SortParam
constructor
A new instance of SortParam.
-
#to_s ⇒ Object
Represent sort as query string.
Methods inherited from QueryParam
Methods inherited from NameValuePair
#name, #name=, #to_h, #value, #value=
Methods inherited from Item
Constructor Details
#initialize(res_field_arr) ⇒ SortParam
Returns a new instance of SortParam.
13 14 15 |
# File 'lib/easy/jsonapi/request/query_param_collection/sort_param.rb', line 13 def initialize(res_field_arr) super('sorts', res_field_arr) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class JSONAPI::Item
Instance Method Details
#to_s ⇒ Object
Represent sort as query string
18 19 20 |
# File 'lib/easy/jsonapi/request/query_param_collection/sort_param.rb', line 18 def to_s "sort=#{JSONAPI::Utility.to_string_collection(value, delimiter: ',')}" end |