Sha256: 1a860514ab22d3732be4d6b3eab2a43a6ce592d24b6479e5c1745fb55d8fc130

Contents?: true

Size: 223 Bytes

Versions: 7

Compression:

Stored size: 223 Bytes

Contents

class CacheKeeper::NewInstanceSerializer < ActiveJob::Serializers::ObjectSerializer
  def serialize(target)
    super("klass" => target.class.to_s)
  end

  def deserialize(json)
    json["klass"].constantize.new
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
cache_keeper-0.6.1 app/serializers/cache_keeper/new_instance_serializer.rb
cache_keeper-0.6.0 app/serializers/cache_keeper/new_instance_serializer.rb
cache_keeper-0.5.1 app/serializers/cache_keeper/new_instance_serializer.rb
cache_keeper-0.5.0 app/serializers/cache_keeper/new_instance_serializer.rb
cache_keeper-0.4.1 app/serializers/cache_keeper/new_instance_serializer.rb
cache_keeper-0.4.0 app/serializers/cache_keeper/new_instance_serializer.rb
cache_keeper-0.3.0 app/serializers/cache_keeper/new_instance_serializer.rb