Module: Cachext::Features::Default

Included in:
Client
Defined in:
lib/cachext/features/default.rb

Instance Method Summary collapse

Instance Method Details

#handle_error(key, options, error) ⇒ Object



9
10
11
# File 'lib/cachext/features/default.rb', line 9

def handle_error key, options, error
  super || (options.default.respond_to?(:call) ? options.default.call(key) : options.default)
end

#handle_not_found(key, options, error) ⇒ Object



4
5
6
7
# File 'lib/cachext/features/default.rb', line 4

def handle_not_found key, options, error
  super
  options.default.respond_to?(:call) ? options.default.call(key) : options.default
end