Sha256: f71481cc48272594a3ca3b9252cfbff86055388a32c52f23b810b2c1951b760b

Contents?: true

Size: 1.09 KB

Versions: 1

Compression:

Stored size: 1.09 KB

Contents

# encoding: UTF-8
module Bin
  class Compatibility < ActiveSupport::Cache::Store
    def increment(key, amount=1)
      yield
    end

    def decrement(key, amount=1)
      yield
    end
  end

  if ActiveSupport::VERSION::STRING < '3'
    class Compatibility
      def write(key, value, options=nil, &block)
        super(key, value, options)
        yield
      end

      def read(key, options=nil, &block)
        super
        yield
      end

      def delete(key, options=nil, &block)
        super
        yield
      end

      def delete_matched(matcher, options=nil, &block)
        super
        yield
      end

      def exist?(key, options=nil, &block)
        super
        yield
      end
    end
  else
    class Compatibility
      def write(key, value, options=nil, &block)
        yield
      end

      def read(key, options=nil, &block)
        yield
      end

      def delete(key, options=nil, &block)
        yield
      end

      def delete_matched(matcher, options=nil, &block)
        yield
      end

      def exist?(key, options=nil, &block)
        yield
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
oahu-bin-0.6.3 lib/bin/compatibility.rb