Class: UzuUzu::Memcache::Dalli

Inherits:
Object
  • Object
show all
Defined in:
lib/uzuuzu-core/memcache/dalli.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(env = nil) ⇒ Dalli

Returns a new instance of Dalli.



15
16
17
18
19
20
21
# File 'lib/uzuuzu-core/memcache/dalli.rb', line 15

def initialize(env=nil)
  @adapter = :dalli
  if env.blank? or env['address'].blank?
    return
  end
  @memcache = Dalli::Client.new("#{env['address']}")
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(action, *args) ⇒ Object



26
27
28
# File 'lib/uzuuzu-core/memcache/dalli.rb', line 26

def method_missing(action, *args)
  @memcahce.send(action, args)
end

Instance Attribute Details

#adapterObject (readonly)

Returns the value of attribute adapter.



11
12
13
# File 'lib/uzuuzu-core/memcache/dalli.rb', line 11

def adapter
  @adapter
end