Module: Graphiti::JsonapiSerializableExt::ResourceForOverride

Defined in:
lib/graphiti/jsonapi_serializable_ext.rb

Overview

See above comment

Instance Method Summary collapse

Instance Method Details

#resource_for(object, options, inferrer) ⇒ Object



40
41
42
43
44
# File 'lib/graphiti/jsonapi_serializable_ext.rb', line 40

def resource_for(object, options, inferrer)
  resource = object.instance_variable_get(:@__graphiti_resource)
  klass = object.instance_variable_get(:@__graphiti_serializer)
  klass.new(options.merge(object: object, resource: resource))
end