Class: Grape::ActiveModelSerializers::SerializerResolver

Inherits:
Object
  • Object
show all
Defined in:
lib/grape-active_model_serializers/serializer_resolver.rb

Instance Method Summary collapse

Constructor Details

#initialize(resource, options) ⇒ SerializerResolver

Returns a new instance of SerializerResolver.


4
5
6
7
# File 'lib/grape-active_model_serializers/serializer_resolver.rb', line 4

def initialize(resource, options)
  self.resource = resource
  self.options = options
end

Instance Method Details

#serializerObject


9
10
11
# File 'lib/grape-active_model_serializers/serializer_resolver.rb', line 9

def serializer
  serializer_class.new(resource, serializer_options) if serializer_class
end