Class: JSONAPI::Renderer::SimpleResourcesProcessor Private

Inherits:
ResourcesProcessor show all
Defined in:
lib/jsonapi/renderer/simple_resources_processor.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Methods inherited from ResourcesProcessor

#process

Instance Method Details

#process_resourcesObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



7
8
9
10
11
12
13
14
15
16
# File 'lib/jsonapi/renderer/simple_resources_processor.rb', line 7

def process_resources
  [@primary, @included].each do |resources|
    resources.map! do |res|
      ri = [res.jsonapi_type, res.jsonapi_id]
      include_dir = @include_rels[ri]
      fields = @fields[res.jsonapi_type.to_sym]
      res.as_jsonapi(include: include_dir, fields: fields)
    end
  end
end