Class: ActiveModelSerializers::Adapter::Attributes

Inherits:
Base
  • Object
show all
Defined in:
lib/active_model_serializers/adapter/attributes.rb

Instance Attribute Summary

Attributes inherited from Base

#instance_options, #serializer

Instance Method Summary collapse

Methods inherited from Base

#as_json, #cache_key, cache_key, default_key_transform, #fragment_cache, fragment_cache, inherited, #initialize, transform, transform_key_casing!

Constructor Details

This class inherits a constructor from ActiveModelSerializers::Adapter::Base

Instance Method Details

#serializable_hash(options = nil) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/active_model_serializers/adapter/attributes.rb', line 4

def serializable_hash(options = nil)
  options = serialization_options(options)
  options[:fields] ||= instance_options[:fields]
  serialized_hash = serializer.serializable_hash(instance_options, options, self)

  self.class.transform_key_casing!(serialized_hash, instance_options)
end