Sha256: e7219983db27b42ac6e7b6ebb1751f80c6eee00193c91e9c7f934e54a474caaf

Contents?: true

Size: 471 Bytes

Versions: 2

Compression:

Stored size: 471 Bytes

Contents

require "cachew/adapter"

module Cachew
  # Null version of Cachew. Never caches anything, and returns value of given
  # block directly.
  class Null < Adapter
    class << self
      # Returns singleton instance of Null adapter.
      # @return [Null]
      def new
        @instance ||= super
      end
    end

    private

    # :nodoc:
    def __get__(*)
      UNDEFINED
    end

    # :nodoc:
    def __set__(*) end

    # :nodoc:
    def __key__(*) end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cachew-0.2.1 lib/cachew/null.rb
cachew-0.2.0 lib/cachew/null.rb