Class: Cache::Config

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#parentObject (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_ttlObject

: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