Module: Eac::SimpleCache

Defined in:
lib/eac/simple_cache.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object



4
5
6
7
8
9
10
11
# File 'lib/eac/simple_cache.rb', line 4

def method_missing(method, *args, &block)
  uncached_method = "#{method}_uncached"
  if respond_to?(uncached_method, true)
    call_method_with_cache(uncached_method, args, &block)
  else
    super
  end
end

Instance Method Details

#reset_cacheObject



17
18
19
# File 'lib/eac/simple_cache.rb', line 17

def reset_cache
  @cache_keys = nil
end

#respond_to?(method, include_all = false) ⇒ Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/eac/simple_cache.rb', line 13

def respond_to?(method, include_all = false)
  super || super("#{method}_uncached", true)
end