Sha256: 7a42bac2048d2dfc817fa500d8e53a6e7452bacee791fb0cd3b38b8c48227977

Contents?: true

Size: 394 Bytes

Versions: 36

Compression:

Stored size: 394 Bytes

Contents

# frozen_string_literal: true

require "bigdecimal"

module ActiveJob
  module Serializers
    class BigDecimalSerializer < ObjectSerializer # :nodoc:
      def serialize(big_decimal)
        super("value" => big_decimal.to_s)
      end

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

      private
        def klass
          BigDecimal
        end
    end
  end
end

Version data entries

36 entries across 36 versions & 4 rubygems

Version Path
activejob-8.0.0 lib/active_job/serializers/big_decimal_serializer.rb
activejob-7.2.2 lib/active_job/serializers/big_decimal_serializer.rb
activejob-7.1.5 lib/active_job/serializers/big_decimal_serializer.rb
activejob-8.0.0.rc2 lib/active_job/serializers/big_decimal_serializer.rb
activejob-7.2.1.2 lib/active_job/serializers/big_decimal_serializer.rb
activejob-7.1.4.2 lib/active_job/serializers/big_decimal_serializer.rb
activejob-8.0.0.rc1 lib/active_job/serializers/big_decimal_serializer.rb
activejob-7.2.1.1 lib/active_job/serializers/big_decimal_serializer.rb
activejob-7.1.4.1 lib/active_job/serializers/big_decimal_serializer.rb
activejob-8.0.0.beta1 lib/active_job/serializers/big_decimal_serializer.rb
omg-activejob-8.0.0.alpha9 lib/active_job/serializers/big_decimal_serializer.rb
omg-activejob-8.0.0.alpha8 lib/active_job/serializers/big_decimal_serializer.rb
omg-activejob-8.0.0.alpha7 lib/active_job/serializers/big_decimal_serializer.rb
omg-activejob-8.0.0.alpha4 lib/active_job/serializers/big_decimal_serializer.rb
omg-activejob-8.0.0.alpha3 lib/active_job/serializers/big_decimal_serializer.rb
omg-activejob-8.0.0.alpha2 lib/active_job/serializers/big_decimal_serializer.rb
omg-activejob-8.0.0.alpha1 lib/active_job/serializers/big_decimal_serializer.rb
activejob-7.1.4 lib/active_job/serializers/big_decimal_serializer.rb
activejob-7.2.1 lib/active_job/serializers/big_decimal_serializer.rb
activejob-7.2.0 lib/active_job/serializers/big_decimal_serializer.rb