Sha256: a475ffe17867b1e01118ba62089dbe16b2ce67357f2b223d7b3cddbde749abed

Contents?: true

Size: 608 Bytes

Versions: 3

Compression:

Stored size: 608 Bytes

Contents

module Roar
  module JSON
    module JSONAPI
      # Defines defaults for JSON API Representers.
      #
      # @api public
      module Defaults
        # Hook called when module is included
        #
        # @param [Class,Module] base
        #   the module or class including Defaults
        #
        # @return [undefined]
        #
        # @api private
        # @see http://www.ruby-doc.org/core/Module.html#method-i-included
        def self.included(base)
          base.defaults do |name, _|
            { as: JSONAPI::MemberName.(name) }
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
roar-jsonapi-0.0.3 lib/roar/json/json_api/defaults.rb
roar-jsonapi-0.0.2 lib/roar/json/json_api/defaults.rb
roar-jsonapi-0.0.1 lib/roar/json/json_api/defaults.rb