Class: Cachengue::Proxy

Inherits:
Object
  • Object
show all
Defined in:
lib/cachengue/proxy.rb

Instance Method Summary collapse

Constructor Details

#initialize(classx) ⇒ Proxy

Returns a new instance of Proxy.



7
8
9
# File 'lib/cachengue/proxy.rb', line 7

def initialize(classx)
  @classx = classx
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name, *args) ⇒ Object (private)



25
26
27
28
29
# File 'lib/cachengue/proxy.rb', line 25

def method_missing(method_name, *args)
  Cachengue::Caching.fetch(@classx, method_name, args) do
    @classx.public_send(method_name, *args)
  end
end

Instance Method Details

#cache_clear ⇒ Object



15
16
17
# File 'lib/cachengue/proxy.rb', line 15

def cache_clear
  Cachengue::Caching.clear(@classx)
end

#cache_keys ⇒ Object



11
12
13
# File 'lib/cachengue/proxy.rb', line 11

def cache_keys
  Cachengue::Caching.keys(@classx)
end