Sha256: 9435bf5a9f8c8a7f166c497868554bb361e226bcb7d9d2f7d904c575f4a62aed
Contents?: true
Size: 496 Bytes
Versions: 7
Compression:
Stored size: 496 Bytes
Contents
require 'redis' module Momm class RedisStore < Storage DEFAULT_OPTIONS = { host: "localhost", port: 6379, namespace: "momm"} attr_accessor :options def initialize(options = {}) @options = DEFAULT_OPTIONS.dup.merge options end def client @client ||= begin ns = options.delete(:namespace) require 'redis/namespace' native_client = Redis.new options Redis::Namespace.new(ns, :redis => native_client) end end end end
Version data entries
7 entries across 7 versions & 1 rubygems