Sha256: 406222cc9ad9e7139ba71fa3c0d7051df051fbf4fd68204128cafc40e152b45c

Contents?: true

Size: 364 Bytes

Versions: 17

Compression:

Stored size: 364 Bytes

Contents

# frozen_string_literal: true

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

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

      private

        def klass
          DateTime
        end
    end
  end
end

Version data entries

17 entries across 17 versions & 4 rubygems

Version Path
activejob-6.0.2.2 lib/active_job/serializers/date_time_serializer.rb
argon-1.3.1 vendor/bundle/ruby/2.7.0/gems/activejob-6.0.2.1/lib/active_job/serializers/date_time_serializer.rb
symbolic_enum-1.1.5 vendor/bundle/ruby/2.7.0/gems/activejob-6.0.2.1/lib/active_job/serializers/date_time_serializer.rb
activejob-6.0.2.1 lib/active_job/serializers/date_time_serializer.rb
activejob-6.0.2 lib/active_job/serializers/date_time_serializer.rb
activejob-6.0.2.rc2 lib/active_job/serializers/date_time_serializer.rb
activejob-6.0.2.rc1 lib/active_job/serializers/date_time_serializer.rb
activejob-6.0.1 lib/active_job/serializers/date_time_serializer.rb
chatops-rpc-0.0.2 fixtures/chatops-controller-example/vendor/bundle/ruby/2.5.0/gems/activejob-6.0.0/lib/active_job/serializers/date_time_serializer.rb
activejob-6.0.1.rc1 lib/active_job/serializers/date_time_serializer.rb
chatops-rpc-0.0.1 fixtures/chatops-controller-example/vendor/bundle/ruby/2.5.0/gems/activejob-6.0.0/lib/active_job/serializers/date_time_serializer.rb
activejob-6.0.0 lib/active_job/serializers/date_time_serializer.rb
activejob-6.0.0.rc2 lib/active_job/serializers/date_time_serializer.rb
activejob-6.0.0.rc1 lib/active_job/serializers/date_time_serializer.rb
activejob-6.0.0.beta3 lib/active_job/serializers/date_time_serializer.rb
activejob-6.0.0.beta2 lib/active_job/serializers/date_time_serializer.rb
activejob-6.0.0.beta1 lib/active_job/serializers/date_time_serializer.rb