Sha256: 93696387bdd6eb18b49250ea43f8a3f31eb065c0bd32d496ef96cac3e4a10912

Contents?: true

Size: 424 Bytes

Versions: 11

Compression:

Stored size: 424 Bytes

Contents

module Scripterator
  class Configuration
    attr_accessor :redis_expiration
    attr_reader   :redis

    # set config.redis = nil to use NilRedis implementation
    def redis=(r)
      @redis = r || Scripterator::NilRedis.new
    end
  end

  class NilRedis
    def smembers(*args)
      []
    end

    %w(expire sadd sismember).each do |redis_method|
      define_method(redis_method) { |*args| nil }
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
scripterator-1.4.0 lib/scripterator/configuration.rb
scripterator-1.4.0.beta1 lib/scripterator/configuration.rb
scripterator-1.3.2 lib/scripterator/configuration.rb
scripterator-1.3.1 lib/scripterator/configuration.rb
scripterator-1.3.0 lib/scripterator/configuration.rb
scripterator-1.2.0 lib/scripterator/configuration.rb
scripterator-1.2.0.pre1 lib/scripterator/configuration.rb
scripterator-1.1.0 lib/scripterator/configuration.rb
scripterator-1.0.0 lib/scripterator/configuration.rb
scripterator-0.1.1 lib/scripterator/configuration.rb
scripterator-0.1.0 lib/scripterator/configuration.rb