Class: Factorix::Cache::Entry

Inherits:
Data
  • Object
show all
Defined in:
lib/factorix/cache/entry.rb,
lib/factorix/cache/entry.rb

Overview

Represents a cache entry for enumeration operations.

Used by Base#each to yield entry metadata alongside keys. Note: The key is NOT included in Entry; it is yielded separately.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#ageFloat (readonly)

Returns age in seconds since creation/modification.

Returns:

  • (Float)

    age in seconds since creation/modification



16
17
18
# File 'lib/factorix/cache/entry.rb', line 16

def age
  @age
end

#sizeInteger (readonly)

Returns entry size in bytes.

Returns:

  • (Integer)

    entry size in bytes



16
17
18
# File 'lib/factorix/cache/entry.rb', line 16

def size
  @size
end

Instance Method Details

#expired?Boolean

Check if the cache entry has expired.

Returns:

  • (Boolean)

    true if entry has exceeded TTL



22
# File 'lib/factorix/cache/entry.rb', line 22

def expired? = expired