class AnyCache::Adapters::ActiveSupportNaiveStore::Operation

@api private @since 0.1.0

Constants

DEAD_TTL

@return [Integer]

@api private @since 0.1.0

NO_EXPIRATION_TTL

@return [NilClass]

@api private @since 0.1.0

READ_MULTI_EMPTY_KEYS_SET

@return [Array]

@api private @since 0.3.0

Attributes

driver[R]

@return [Object]

@api private @since 0.1.0

Public Class Methods

new(driver) click to toggle source

@param driver [Object] @return [void]

@api private @since 0.1.0

# File lib/any_cache/adapters/active_support_naive_store/operation.rb, line 36
def initialize(driver)
  @driver = driver
end

Private Instance Methods

calc_entry_expiration(entry) click to toggle source

@param [ActiveSupport::Cache::Entry] @return [NilClass, Integer]

@api private @since 0.1.0

# File lib/any_cache/adapters/active_support_naive_store/operation.rb, line 62
def calc_entry_expiration(entry)
  entry.expires_at ? (entry.expires_at - calc_epoch_time) : NO_EXPIRATION_TTL
end
calc_epoch_time(as_integer: false) click to toggle source

@option as_integer [Boolean] @return [Integer, Float]

@api private @since 0.1.0

# File lib/any_cache/adapters/active_support_naive_store/operation.rb, line 53
def calc_epoch_time(as_integer: false)
  as_integer ? Time.now.to_i : Time.now.to_f
end