Class: ESI::Config::CacheConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/esi/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCacheConfig

Returns a new instance of CacheConfig.



77
78
79
80
# File 'lib/esi/config.rb', line 77

def initialize
  @memcached = false
  @options = OpenStruct.new({}) 
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



76
77
78
# File 'lib/esi/config.rb', line 76

def options
  @options
end

Instance Method Details

#lockedObject



91
92
93
# File 'lib/esi/config.rb', line 91

def locked
  !@memcached
end

#memcached {|@options| ... } ⇒ Object

Yields:



82
83
84
85
# File 'lib/esi/config.rb', line 82

def memcached
  @memcached = true
  yield @options
end

#memcached?Boolean

Returns:

  • (Boolean)


87
88
89
# File 'lib/esi/config.rb', line 87

def memcached?
  @memcached
end

#ttl=(ttl) ⇒ Object



95
96
97
# File 'lib/esi/config.rb', line 95

def ttl=( ttl )
  @options.ttl = ttl
end