Module: Roar::JSON::JSONAPI::Defaults

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

Overview

Defines defaults for JSON API Representers.

Class Method Summary collapse

Class Method Details

.included(base) ⇒ undefined

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.

Hook called when module is included

Parameters:

  • base (Class, Module)

    the module or class including Defaults

Returns:

  • (undefined)

See Also:



17
18
19
20
21
# File 'lib/roar/json/json_api/defaults.rb', line 17

def self.included(base)
  base.defaults do |name, _|
    { as: JSONAPI::MemberName.(name) }
  end
end