Class: Jat::Plugins::JsonApi::Params::Include

Inherits:
Object
  • Object
show all
Defined in:
lib/jat/plugins/json_api/lib/params/include.rb,
lib/jat/plugins/json_api/lib/params/include/parse.rb,
lib/jat/plugins/json_api/lib/params/include/validate.rb

Defined Under Namespace

Classes: Parse, Validate

Class Method Summary collapse

Class Method Details

.call(jat, includes_string) ⇒ Object

returns Hash { type => [attr1, attr2] }



13
14
15
16
17
18
19
20
21
# File 'lib/jat/plugins/json_api/lib/params/include.rb', line 13

def call(jat, includes_string)
  return {} unless includes_string

  jat_class = jat.class
  includes = Parse.call(includes_string)
  Validate.call(jat_class, includes)

  typed_includes(jat_class, includes, {})
end