Sha256: 88ac8581deb737d20c9ef19d5fb4c04421fd66c25c20536b955176870a962319
Contents?: true
Size: 509 Bytes
Versions: 17
Compression:
Stored size: 509 Bytes
Contents
# frozen_string_literal: true module ActiveJob module Serializers class DurationSerializer < ObjectSerializer # :nodoc: def serialize(duration) super("value" => duration.value, "parts" => Arguments.serialize(duration.parts)) end def deserialize(hash) value = hash["value"] parts = Arguments.deserialize(hash["parts"]) klass.new(value, parts) end private def klass ActiveSupport::Duration end end end end
Version data entries
17 entries across 17 versions & 4 rubygems