Class: JSONAPI::Request::QueryParamCollection::IncludeParam

Inherits:
QueryParam show all
Defined in:
lib/easy/jsonapi/request/query_param_collection/include_param.rb

Overview

The include query param

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(includes_arr) ⇒ IncludeParam

Returns a new instance of IncludeParam.

Parameters:

  • includes_arr (Array<String>)

    An array with each individual query include Ex: incude=author,people => [‘author’, ‘people’]



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

def initialize(includes_arr)
  includes_hash_structure = store_includes(includes_arr)
  super('includes', includes_hash_structure)
end

Dynamic Method Handling

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

Instance Method Details

#to_sObject

to string



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

def to_s
  "include=#{stringify_includes_hash(value)}"
end