class JSONAPI::Request::QueryParamCollection::FieldsParam

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

Public Class Methods

new(fieldset_arr) click to toggle source

@param fieldset_arr [Array<JSONAPI::Request::QueryParamCollection::FieldsParam::Fieldset>]

The array of fieldsets found in the query string. Ex: fields[resource]=res_field1,res_field2
Calls superclass method
# File lib/easy/jsonapi/request/query_param_collection/fields_param.rb, line 13
def initialize(fieldset_arr)
  super('fields', fieldset_arr)
end

Public Instance Methods

fieldsets() click to toggle source

Alias to parent value method @return [Array<JSONAPI::Request::QueryParamCollection::FieldsParam::Fieldset>]

# File lib/easy/jsonapi/request/query_param_collection/fields_param.rb, line 19
def fieldsets
  value
end
to_s() click to toggle source

@return The the query string representation of the included fieldsets

ex: "#{fieldset1.to_s}&{fieldset2.to_s}&..."
# File lib/easy/jsonapi/request/query_param_collection/fields_param.rb, line 25
def to_s
  JSONAPI::Utility.to_string_collection(value, delimiter: '&')
end