Sha256: 06518361c638bca7c3911a07ff1078e1e68f87eab429b066a71a3e042e74b6c5

Contents?: true

Size: 892 Bytes

Versions: 1

Compression:

Stored size: 892 Bytes

Contents

# frozen_string_literal: true

module AnyCache::Adapters
  # @api private
  # @since 0.1.0
  class Delegator < Basic
    class << self
      # @param driver [Object]
      # @return [Boolean]
      #
      # @api private
      # @since 0.1.0
      def supported_driver?(driver)
        driver.respond_to?(:read) &&
        driver.respond_to?(:write) &&
        driver.respond_to?(:delete) &&
        driver.respond_to?(:increment) &&
        driver.respond_to?(:decrement) &&
        driver.respond_to?(:expire) &&
        driver.respond_to?(:persist) &&
        driver.respond_to?(:clear)
      end
    end

    # @since 0.1.0
    def_delegators :driver,
                   :read,
                   :write,
                   :delete,
                   :increment,
                   :decrement,
                   :expire,
                   :persist,
                   :clear
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
any_cache-0.1.0 lib/any_cache/adapters/delegator.rb