Class: ActiveSupport::Cache::MemcacheConnectionPool

Inherits:
Object
  • Object
show all
Defined in:
lib/active_support/cache/memcache_connection_pool.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ MemcacheConnectionPool

Returns a new instance of MemcacheConnectionPool.



6
7
8
# File 'lib/active_support/cache/memcache_connection_pool.rb', line 6

def initialize(options)
  @options = options
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



4
5
6
# File 'lib/active_support/cache/memcache_connection_pool.rb', line 4

def options
  @options
end

Instance Method Details

#decrement(name, amount = 1, options = nil) ⇒ Object



52
53
54
55
56
# File 'lib/active_support/cache/memcache_connection_pool.rb', line 52

def decrement(name, amount = 1, options=nil)
  with_connection do
    connection.decrement name, amount, options
  end
end

#delete(name, options = nil) ⇒ Object



34
35
36
37
38
# File 'lib/active_support/cache/memcache_connection_pool.rb', line 34

def delete(name, options=nil)
  with_connection do
    connection.delete name, options
  end
end

#exist?(name, options = nil) ⇒ Boolean

Returns:

  • (Boolean)


28
29
30
31
32
# File 'lib/active_support/cache/memcache_connection_pool.rb', line 28

def exist?(name, options=nil)
  with_connection do
    connection.exist? name, options
  end
end

#fetch(name, options = nil) ⇒ Object



10
11
12
13
14
# File 'lib/active_support/cache/memcache_connection_pool.rb', line 10

def fetch(name, options=nil)
  with_connection do
    connection.fetch name, options
  end
end

#increment(name, amount = 1, options = nil) ⇒ Object



46
47
48
49
50
# File 'lib/active_support/cache/memcache_connection_pool.rb', line 46

def increment(name, amount = 1, options=nil)
  with_connection do
    connection.increment name, amount, options
  end
end

#read(name, options = nil) ⇒ Object



16
17
18
19
20
# File 'lib/active_support/cache/memcache_connection_pool.rb', line 16

def read(name, options=nil)
  with_connection do
    connection.read name, options
  end
end

#read_multi(*names) ⇒ Object



40
41
42
43
44
# File 'lib/active_support/cache/memcache_connection_pool.rb', line 40

def read_multi(*names)
  with_connection do
    connection.read_multi *names
  end
end

#reset(options = {}) ⇒ Object Also known as: clear



58
59
60
61
62
# File 'lib/active_support/cache/memcache_connection_pool.rb', line 58

def reset(options={})
  with_connection do
    connection.reset options
  end
end

#write(name, value, options = nil) ⇒ Object



22
23
24
25
26
# File 'lib/active_support/cache/memcache_connection_pool.rb', line 22

def write(name, value, options=nil)
  with_connection do
    connection.write name, value, options
  end
end