Sha256: bccfdf7707f2a11694d25d2137d7db74601317ab9b6948554c22e4ac65f63f40

Contents?: true

Size: 906 Bytes

Versions: 3

Compression:

Stored size: 906 Bytes

Contents

class Redis
  class Store < self
    include Ttl, Interface

    def initialize(options = { })
      super
      _extend_marshalling options
      _extend_namespace   options
    end

    def self.rails3? #:nodoc:
      defined?(::Rails) && ::Rails::VERSION::MAJOR == 3
    end

    def self.rails31? #:nodoc:
      defined?(::Rails) && ::Rails::VERSION::MAJOR == 3 && ::Rails::VERSION::MINOR == 1
    end

    def reconnect
      @client.reconnect
    end

    def to_s
      "Redis Client connected to #{@client.host}:#{@client.port} against DB #{@client.db}"
    end

    private
      def _extend_marshalling(options)
        @marshalling = !(options[:marshalling] === false) # HACK - TODO delegate to Factory
        extend Marshalling if @marshalling
      end

      def _extend_namespace(options)
        @namespace = options[:namespace]
        extend Namespace if @namespace
      end
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
instructure-redis-store-1.0.0.2.instructure1 lib/redis/store.rb
instructure-redis-store-1.0.0.1.instructure1 lib/redis/store.rb
redis-store-1.0.0.1 lib/redis/store.rb