Sha256: 8f281143f6de74f80cb64e07e0acb80dfb01d1b4bd4daf7ef7c7b819cad440ad

Contents?: true

Size: 395 Bytes

Versions: 22

Compression:

Stored size: 395 Bytes

Contents

# frozen_string_literal: true

module ActiveJob
  module Serializers
    class TimeWithZoneSerializer < ObjectSerializer # :nodoc:
      def serialize(time)
        super("value" => time.iso8601)
      end

      def deserialize(hash)
        Time.iso8601(hash["value"]).in_time_zone
      end

      private
        def klass
          ActiveSupport::TimeWithZone
        end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
activejob-6.0.3 lib/active_job/serializers/time_with_zone_serializer.rb
activejob-6.0.3.rc1 lib/active_job/serializers/time_with_zone_serializer.rb