class Fontist::Cache::Store::CacheEntry
Cache entry with TTL support
Attributes
Public Class Methods
Source
# File lib/fontist/cache/store.rb, line 111 def initialize(value, ttl) @value = value @expires_at = ttl ? (Time.now + ttl).to_i : nil end
Public Instance Methods
Source
# File lib/fontist/cache/store.rb, line 116 def expired? !!(@expires_at && Time.now.to_i > @expires_at) end