Method: Merb::Cache::ControllerInstanceMethods#cached?

Defined in:
lib/merb-cache/cache-fragment.rb

#cached?(options) ⇒ Boolean

Checks whether a cache entry exists

Parameter

options<String,Hash>

The options that will be passed to #key_for

Returns

true if the cache entry exists, false otherwise

Example

cached_action?("my_key")

Returns:

  • (Boolean)


14
15
16
17
# File 'lib/merb-cache/cache-fragment.rb', line 14

def cached?(options)
  key = Merb::Controller._cache.key_for(options, controller_name)
  Merb::Controller._cache.store.cached?(key)
end