Sha256: 3a50f8709881dcf67b050eb32e33795fcc898cdd72f914234bcee898ad2485f6

Contents?: true

Size: 348 Bytes

Versions: 5

Compression:

Stored size: 348 Bytes

Contents

require 'redis'

module Copy
  module Storage
    class Redis
      def initialize(connection_url)
        @redis = ::Redis.new(connection_url)
      end
      
      def get(name)
        @redis.hget("copy:content", name)
      end
      
      def set(name, content)
        @redis.hset("copy:content", name, content)
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
copy-0.0.41 lib/copy/storage/redis.rb
copy-0.0.4 lib/copy/storage/redis.rb
copy-0.0.3 lib/copy/storage/redis.rb
copy-0.0.2 lib/copy/storage/redis.rb
copy-0.0.1 lib/copy/storage/redis.rb