Module: CachedResource
- Defined in:
- lib/cached_resource.rb,
lib/cached_resource/config.rb,
lib/cached_resource/caching.rb,
lib/cached_resource/version.rb
Defined Under Namespace
Modules: Caching Classes: Config
Constant Summary collapse
- VERSION =
"1.0.1"
Class Method Summary collapse
-
.cache ⇒ Object
retrieve the configured cache store.
-
.config ⇒ Object
Retrieve the configuration object.
-
.logger ⇒ Object
retrieve the configured logger.
-
.off! ⇒ Object
Switch cache usage off.
-
.on! ⇒ Object
Switch cache usage on.
Class Method Details
.cache ⇒ Object
retrieve the configured cache store
27 28 29 |
# File 'lib/cached_resource.rb', line 27 def self.cache config.cache end |
.config ⇒ Object
Retrieve the configuration object
32 33 34 |
# File 'lib/cached_resource.rb', line 32 def self.config @@config ||= CachedResource::Config.instance end |
.logger ⇒ Object
retrieve the configured logger
22 23 24 |
# File 'lib/cached_resource.rb', line 22 def self.logger config.logger end |
.off! ⇒ Object
Switch cache usage off
12 13 14 |
# File 'lib/cached_resource.rb', line 12 def self.off! self.config.cache_enabled = false end |
.on! ⇒ Object
Switch cache usage on
17 18 19 |
# File 'lib/cached_resource.rb', line 17 def self.on! self.config.cache_enabled = true end |