Class: JSONAPI::Request::QueryParamCollection::FilterParam::Filter
- Inherits:
-
Object
- Object
- JSONAPI::Request::QueryParamCollection::FilterParam::Filter
- Defined in:
- lib/easy/jsonapi/request/query_param_collection/filter_param/filter.rb
Overview
Represents an individual Filtering scheme for the filter query param(s) used.
Instance Attribute Summary collapse
-
#filter ⇒ Object
readonly
Returns the value of attribute filter.
-
#resource_type ⇒ Object
readonly
Returns the value of attribute resource_type.
Instance Method Summary collapse
-
#initialize(resource_type, filter) ⇒ Filter
constructor
A new instance of Filter.
-
#to_s ⇒ Object
Represent filter as an individual filter query param.
-
#value ⇒ String
The value of the filter.
Constructor Details
#initialize(resource_type, filter) ⇒ Filter
Returns a new instance of Filter.
16 17 18 19 |
# File 'lib/easy/jsonapi/request/query_param_collection/filter_param/filter.rb', line 16 def initialize(resource_type, filter) @resource_type = resource_type @filter = filter end |
Instance Attribute Details
#filter ⇒ Object (readonly)
Returns the value of attribute filter.
12 13 14 |
# File 'lib/easy/jsonapi/request/query_param_collection/filter_param/filter.rb', line 12 def filter @filter end |
#resource_type ⇒ Object (readonly)
Returns the value of attribute resource_type.
12 13 14 |
# File 'lib/easy/jsonapi/request/query_param_collection/filter_param/filter.rb', line 12 def resource_type @resource_type end |
Instance Method Details
#to_s ⇒ Object
Represent filter as an individual filter query param
27 28 29 |
# File 'lib/easy/jsonapi/request/query_param_collection/filter_param/filter.rb', line 27 def to_s "filter[#{@resource_type}]=#{@filter}" end |
#value ⇒ String
Returns The value of the filter.
22 23 24 |
# File 'lib/easy/jsonapi/request/query_param_collection/filter_param/filter.rb', line 22 def value @filter end |