Class: PaperTrail::AttributeSerializers::CastAttributeSerializer
- Inherits:
-
Object
- Object
- PaperTrail::AttributeSerializers::CastAttributeSerializer
- Defined in:
- lib/paper_trail/attribute_serializers/cast_attribute_serializer.rb
Overview
The ‘CastAttributeSerializer` (de)serializes model attribute values. For example, the string “1.99” serializes into the integer `1` when assigned to an attribute of type `ActiveRecord::Type::Integer`.
Instance Method Summary collapse
-
#initialize(klass) ⇒ CastAttributeSerializer
constructor
A new instance of CastAttributeSerializer.
Constructor Details
#initialize(klass) ⇒ CastAttributeSerializer
Returns a new instance of CastAttributeSerializer.
12 13 14 |
# File 'lib/paper_trail/attribute_serializers/cast_attribute_serializer.rb', line 12 def initialize(klass) @klass = klass end |