dplummer/cachext

View on GitHub
lib/cachext/features/default.rb

Summary

Maintainability
A
0 mins
Test Coverage
module Cachext
  module Features
    module Default
      def handle_not_found key, options, error
        super
        options.default.respond_to?(:call) ? options.default.call(key) : options.default
      end

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