class JsonApiReflectionReceiver

We use this when a serializer has a reflection with a block argument, like this:

has_many :users do
  include_data false
  link(:related) { users_company_path(object) }
end

The only way to find out what options get set in that block is to run it, so this class does that and records what is there.

Attributes

result_include_data[R]
serializer[R]

Public Class Methods

new(serializer) click to toggle source
# File lib/active_model_serializers/adapter/json_api_pg.rb, line 334
def initialize(serializer)
  @serializer = serializer
  @result_include_data = true
  @result_links = {}
end

Public Instance Methods

include_data(val) click to toggle source
# File lib/active_model_serializers/adapter/json_api_pg.rb, line 340
def include_data(val)
  @result_include_data = val
end
object() click to toggle source
# File lib/active_model_serializers/adapter/json_api_pg.rb, line 359
def object
  # TODO: Could even be a singleton
  JsonApiObjectProxy.new
end