Class: Cache::Config
- Inherits:
-
Object
- Object
- Cache::Config
- Defined in:
- lib/cache/config.rb
Overview
Here’s where config options are kept.
Example:
cache.config.default_ttl = 120 # seconds
Instance Attribute Summary collapse
-
#parent ⇒ Object
readonly
Returns the value of attribute parent.
Instance Method Summary collapse
-
#default_ttl ⇒ Object
:nodoc:.
-
#default_ttl=(seconds) ⇒ Object
TTL for method caches.
-
#initialize(parent) ⇒ Config
constructor
:nodoc:.
Constructor Details
#initialize(parent) ⇒ Config
:nodoc:
10 11 12 |
# File 'lib/cache/config.rb', line 10 def initialize(parent) #:nodoc: @parent = parent end |
Instance Attribute Details
#parent ⇒ Object (readonly)
Returns the value of attribute parent.
8 9 10 |
# File 'lib/cache/config.rb', line 8 def parent @parent end |
Instance Method Details
#default_ttl ⇒ Object
:nodoc:
22 23 24 |
# File 'lib/cache/config.rb', line 22 def default_ttl #:nodoc: @default_ttl || 60 end |
#default_ttl=(seconds) ⇒ Object
TTL for method caches. Defaults to 60 seconds.
Example:
cache.config.default_ttl = 120 # seconds
18 19 20 |
# File 'lib/cache/config.rb', line 18 def default_ttl=(seconds) @default_ttl = seconds end |