Class: JSONAPI::Request::QueryParamCollection::FilterParam

Inherits:
QueryParam show all
Defined in:
lib/easy/jsonapi/request/query_param_collection/filter_param.rb,
lib/easy/jsonapi/request/query_param_collection/filter_param/filter.rb

Overview

Used to create a unique Filter JSONAPI::Request::QueryParamCollection::QueryParam

Defined Under Namespace

Classes: Filter

Instance Attribute Summary

Attributes inherited from Item

#item

Instance Method Summary collapse

Methods inherited from QueryParam

#name=, #value=

Methods inherited from NameValuePair

#name, #name=, #to_h, #value, #value=

Methods inherited from Item

#to_h

Constructor Details

#initialize(filter_arr) ⇒ FilterParam

Returns a new instance of FilterParam.

Parameters:



15
16
17
# File 'lib/easy/jsonapi/request/query_param_collection/filter_param.rb', line 15

def initialize(filter_arr)
  super('filters', filter_arr)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class JSONAPI::Item

Instance Method Details

#to_sObject

Represent each filter separated by a & value

Ex: "#{filter1.to_s}&{filter2.to_s}&..."


21
22
23
# File 'lib/easy/jsonapi/request/query_param_collection/filter_param.rb', line 21

def to_s
  JSONAPI::Utility.to_string_collection(value, delimiter: '&')
end