Class: Rack::PageSpeed::Store::Memcached

Inherits:
Object
  • Object
show all
Defined in:
lib/rack/pagespeed/store/memcached.rb

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Memcached

Returns a new instance of Memcached.



8
9
10
11
# File 'lib/rack/pagespeed/store/memcached.rb', line 8

def initialize *args
  @client = Dalli::Client.new *args
  # @client.stats # let it raise errors if it can't connect
end

Instance Method Details

#[](key) ⇒ Object



13
14
15
# File 'lib/rack/pagespeed/store/memcached.rb', line 13

def [] key
  @client.get key
end

#[]=(key, value) ⇒ Object



17
18
19
20
# File 'lib/rack/pagespeed/store/memcached.rb', line 17

def []= key, value
  @client.set key, value
  true
end