Sha256: 5691abac4bd321f7f7276fe4f80bdc2c1295e0407df3f68cb0335bd9e1dedef6
Contents?: true
Size: 897 Bytes
Versions: 12
Compression:
Stored size: 897 Bytes
Contents
# frozen_string_literal: true require 'easy/jsonapi/request/query_param_collection/query_param' require 'easy/jsonapi/utility' module JSONAPI class Request class QueryParamCollection < JSONAPI::NameValuePairCollection # Used to create a unique Filter JSONAPI::Request::QueryParamCollection::QueryParam class FilterParam < QueryParam # @param filter_arr [Array<JSONAPI::Request::QueryParamCollection::FilterParam::Filter>] # The array of filters included in the query string. Ex: filter[articles]=(posted_date == today) def initialize(filter_arr) super('filters', filter_arr) end # Represent each filter separated by a & value # Ex: "#{filter1.to_s}&{filter2.to_s}&..." def to_s JSONAPI::Utility.to_string_collection(value, delimiter: '&') end end end end end
Version data entries
12 entries across 12 versions & 1 rubygems