Sha256: ea99d73fea5756d1c4a06207c9083fe480b49bd0e3d95b5f013e6701f7cdbcd3
Contents?: true
Size: 663 Bytes
Versions: 9
Compression:
Stored size: 663 Bytes
Contents
# frozen_string_literal: true module Paquito module CacheEntryCoder def self.dump(entry) attrs = [entry.value, entry.expires_at, entry.version] # drop any trailing nil values to save a couple bytes attrs.pop until !attrs.last.nil? || attrs.empty? attrs end def self.load(payload) entry = ::ActiveSupport::Cache::Entry.allocate value, expires_in, version = payload entry.instance_variable_set(:@value, value) entry.instance_variable_set(:@expires_in, expires_in) entry.instance_variable_set(:@created_at, 0.0) entry.instance_variable_set(:@version, version) entry end end end
Version data entries
9 entries across 9 versions & 1 rubygems