Class: Cachengue::Proxy
- Inherits:
-
Object
show all
- Defined in:
- lib/cachengue/proxy.rb
Instance Method Summary
collapse
Constructor Details
#initialize(classx, options = {}) ⇒ Proxy
Returns a new instance of Proxy.
7
8
9
10
|
# File 'lib/cachengue/proxy.rb', line 7
def initialize(classx, options = {})
@classx = classx
@options = options
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args) ⇒ Object
26
27
28
29
30
|
# File 'lib/cachengue/proxy.rb', line 26
def method_missing(method_name, *args)
Cachengue::Caching.fetch(@classx, method_name, args, @options) do
@classx.public_send(method_name, *args)
end
end
|
Instance Method Details
#cache_clear ⇒ Object
16
17
18
|
# File 'lib/cachengue/proxy.rb', line 16
def cache_clear
Cachengue::Caching.clear(@classx)
end
|
#cache_keys ⇒ Object
12
13
14
|
# File 'lib/cachengue/proxy.rb', line 12
def cache_keys
Cachengue::Caching.keys(@classx)
end
|