Sha256: 510441e5fcbcad81223e076a48d2196f5d93a94e2a1816c46ae62d51baa9c4b0

Contents?: true

Size: 501 Bytes

Versions: 5

Compression:

Stored size: 501 Bytes

Contents

module Intro
  class Cache
    class << self
      def write(controller, action, value)
        Rails.cache.write(cache_token(controller, action), value)
      end

      def read(controller, action)
        Rails.cache.read(cache_token(controller, action))
      end

      def delete(controller, action)
        Rails.cache.delete(cache_token(controller, action))
      end

      private

      def cache_token(controller, action)
        "intro-#{controller}-#{action}"
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
intro-0.4.1 lib/intro/cache.rb
intro-0.4.0 lib/intro/cache.rb
intro-0.3.0 lib/intro/cache.rb
intro-0.2.0 lib/intro/cache.rb
intro-0.1.0 lib/intro/cache.rb