module Deferrer
  module Configuration

    attr_reader :redis
    attr_accessor :logger
    attr_accessor :inline

    # Deferrer.redis_config = { :host => "localhost", :port => 6379 }
    def redis_config=(config)
      @redis = Redis.new(config)
    end

    def log(type, message)
      logger.send(type, message) if logger
    end
  end
end

module Deferrer
  module Configuration

    attr_accessor :redis
    attr_accessor :logger
    attr_accessor :inline

    # Convenience for instantiating Redis.
    #
    # Example:
    #   Deferrer.redis_config = { :host => "localhost", :port => 6379 }
    def redis_config=(config)
      @redis = Redis.new(config)
    end

    def log(type, message)
      logger.send(type, message) if logger
    end
  end
end

Allow the user to provide their own Redis.
Allow the user to provide their own Redis.

This allows the user to provide, for instance, a namespaced Redis.
