module Roar::JSON::JSONAPI::Meta

Meta information API for JSON API Representers.

@api public

Public Class Methods

included(base) click to toggle source

Hook called when module is included

@param [Class,Module] base

the module or class including JSONAPI

@return [undefined]

@api private @see www.ruby-doc.org/core/Module.html#method-i-included

# File lib/roar/json/json_api/meta.rb, line 17
def self.included(base)
  base.extend ClassMethods
end

Private Instance Methods

render_meta(options) click to toggle source
# File lib/roar/json/json_api/meta.rb, line 47
def render_meta(options)
  representer = representable_attrs[:meta_representer]
  meta        = representer ? representer.new(represented).to_hash : {}
  meta.merge!(options[:meta]) if options[:meta]
  meta
end