class JSONAPI::Request::QueryParamCollection::FieldsParam::Fieldset

Collection of fields related to specific resource objects

Attributes

fields[R]
resource_type[R]

Public Class Methods

new(resource_type, field_arr = []) click to toggle source

@param field_arr [Array<JSONAPI::Field>]

A fieldset is a collection of Resource Fields
# File lib/easy/jsonapi/request/query_param_collection/fields_param/fieldset.rb, line 18
def initialize(resource_type, field_arr = [])
  @resource_type = resource_type
  @fields = field_arr
end

Public Instance Methods

to_s() click to toggle source

Represention of Fieldset as a string where fields

are comma separated strings
# File lib/easy/jsonapi/request/query_param_collection/fields_param/fieldset.rb, line 25
def to_s
  pre_string = "fields[#{@resource_type}]="
  JSONAPI::Utility.to_string_collection(@fields, delimiter: ',', pre_string: pre_string)
end