Module: Roar::JSON::JSONAPI::ForCollection Private

Defined in:
lib/roar/json/json_api/for_collection.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.

Instance Method Summary collapse

Instance Method Details

#collection_representer!(_options) ⇒ Object

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.



6
7
8
9
10
11
12
13
14
15
# File 'lib/roar/json/json_api/for_collection.rb', line 6

def collection_representer!(_options)
  singular = self # e.g. Song::Representer

  nested_builder.(_base: default_nested_class, _features: [Roar::JSON, Roar::Hypermedia, JSONAPI::Defaults, JSONAPI::Meta], _block: proc do
    collection :to_a, as: :data, decorator: singular, wrap: false

    include Document
    include ResourceCollection
  end)
end