Class: ESI::Config::CacheConfig
- Inherits:
-
Object
- Object
- ESI::Config::CacheConfig
- Defined in:
- lib/esi/config.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize ⇒ CacheConfig
constructor
A new instance of CacheConfig.
- #locked ⇒ Object
- #memcached {|@options| ... } ⇒ Object
- #memcached? ⇒ Boolean
- #ttl=(ttl) ⇒ Object
Constructor Details
#initialize ⇒ CacheConfig
Returns a new instance of CacheConfig.
78 79 80 81 |
# File 'lib/esi/config.rb', line 78 def initialize @memcached = false @options = OpenStruct.new({}) end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
77 78 79 |
# File 'lib/esi/config.rb', line 77 def @options end |
Instance Method Details
#locked ⇒ Object
92 93 94 |
# File 'lib/esi/config.rb', line 92 def locked !@memcached end |
#memcached {|@options| ... } ⇒ Object
83 84 85 86 |
# File 'lib/esi/config.rb', line 83 def memcached @memcached = true yield @options end |
#memcached? ⇒ Boolean
88 89 90 |
# File 'lib/esi/config.rb', line 88 def memcached? @memcached end |
#ttl=(ttl) ⇒ Object
96 97 98 |
# File 'lib/esi/config.rb', line 96 def ttl=( ttl ) @options.ttl = ttl end |