Sha256: 482294534efe1f95bb493c9ddaec0541ab6155d0b8c32c4e122f2011dd97085d

Contents?: true

Size: 468 Bytes

Versions: 12

Compression:

Stored size: 468 Bytes

Contents

class CacheKeeper::CachedMethodSerializer < ActiveJob::Serializers::ObjectSerializer
  def serialize?(argument)
    argument.is_a? CacheKeeper::CachedMethod
  end

  def serialize(cached_method)
    super(
      "klass" => cached_method.klass,
      "method_name" => cached_method.method_name,
      "options" => cached_method.options
    )
  end

  def deserialize(hash)
    CacheKeeper::CachedMethod.new hash["klass"], hash["method_name"], hash["options"]
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
cache_keeper-0.6.1 app/serializers/cache_keeper/cached_method_serializer.rb
cache_keeper-0.6.0 app/serializers/cache_keeper/cached_method_serializer.rb
cache_keeper-0.5.1 app/serializers/cache_keeper/cached_method_serializer.rb
cache_keeper-0.5.0 app/serializers/cache_keeper/cached_method_serializer.rb
cache_keeper-0.4.1 app/serializers/cache_keeper/cached_method_serializer.rb
cache_keeper-0.4.0 app/serializers/cache_keeper/cached_method_serializer.rb
cache_keeper-0.3.0 app/serializers/cache_keeper/cached_method_serializer.rb
cache_keeper-0.2.1 app/serializers/cache_keeper/cached_method_serializer.rb
cache_keeper-0.2.0 app/serializers/cache_keeper/cached_method_serializer.rb
cache_keeper-0.1.2 app/serializers/cache_keeper/cached_method_serializer.rb
cache_keeper-0.1.1 app/serializers/cache_keeper/cached_method_serializer.rb
cache_keeper-0.1.0 app/serializers/cache_keeper/cached_method_serializer.rb