Method: ActiveSupport::Cache::Store#exist?
- Defined in:
- lib/active_support/cache.rb
#exist?(name, options = nil) ⇒ Boolean
Returns true if the cache contains an entry for the given key.
Options are passed to the underlying cache implementation.
713 714 715 716 717 718 719 720 721 |
# File 'lib/active_support/cache.rb', line 713 def exist?(name, = nil) = () key = normalize_key(name, ) instrument(:exist?, key) do |payload| entry = read_entry(key, **, event: payload) (entry && !entry.expired? && !entry.mismatched?(normalize_version(name, ))) || false end end |