Class: Cachy::Wrapper

Inherits:
Object
  • Object
show all
Defined in:
lib/cachy/wrapper.rb

Direct Known Subclasses

MemcachedWrapper, MonetaWrapper, RedisWrapper

Instance Method Summary collapse

Constructor Details

#initialize(wrapped) ⇒ Wrapper

Returns a new instance of Wrapper.



2
3
4
# File 'lib/cachy/wrapper.rb', line 2

def initialize(wrapped)
  @wrapped = wrapped
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, args) ⇒ Object



10
11
12
# File 'lib/cachy/wrapper.rb', line 10

def method_missing(name, args)
  @wrapped.send(name, *args)
end

Instance Method Details

#read(key) ⇒ Object



6
7
8
# File 'lib/cachy/wrapper.rb', line 6

def read(key)
  @wrapped[key]
end

#respond_to?(x) ⇒ Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/cachy/wrapper.rb', line 14

def respond_to?(x)
  super(x) || @wrapped.respond_to?(x)
end