Class: ActiveJob::Serializers::BigDecimalSerializer

Inherits:
ObjectSerializer show all
Defined in:
activejob/lib/active_job/serializers/big_decimal_serializer.rb

Overview

:nodoc:

Instance Method Summary collapse

Methods inherited from ObjectSerializer

#serialize?

Methods included from Singleton

#duplicable?

Instance Method Details

#deserialize(hash) ⇒ Object



12
13
14
# File 'activejob/lib/active_job/serializers/big_decimal_serializer.rb', line 12

def deserialize(hash)
  BigDecimal(hash["value"])
end

#serialize(big_decimal) ⇒ Object



8
9
10
# File 'activejob/lib/active_job/serializers/big_decimal_serializer.rb', line 8

def serialize(big_decimal)
  super("value" => big_decimal.to_s)
end