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.



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

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

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



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

def options
  @options
end

Instance Method Details

#lockedObject



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

def locked
  !@memcached
end

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

Yields:



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

def memcached
  @memcached = true
  yield @options
end

#memcached?Boolean

Returns:

  • (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