Sha256: ed2782dd653b35ae3f857382eecd432fc87f3a416257ff57f14cdac2d326f252

Contents?: true

Size: 565 Bytes

Versions: 1

Compression:

Stored size: 565 Bytes

Contents

require 'coin'
require 'digest'
require 'singleton'
# # configure the URI that the DRb server runs on (defaults to druby://localhost:PORT)


module Shhh
  module App
    class Cache

      include Singleton

      class << self
        def configure
          Coin.uri = 'druby://127.0.0.1:24924'
        end
      end

      self.configure

      def md5(string)
        Digest::MD5.base64digest(string)
      end

      def [] (key)
        Coin.read(md5(key))
      end

      def []=(key, value)
        Coin.write(md5(key), value)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
shhh-1.6.4 lib/shhh/app/cache.rb