Module: Roar::JSON::JSONAPI::Fragment Private

Defined in:
lib/roar/json/json_api.rb

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

Constant Summary collapse

Included =

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

->(included, options) do
  return unless included && included.any?
  return if options[:included] == false

  type_and_id_seen = Set.new

  included = included.select { |object|
    type_and_id_seen.add? [object['type'], object['id']]
  }

  included
end