Sha256: 8fd5282da38e6c760218a59be8b97266c02776cef2f4649bd4981913824dc64f

Contents?: true

Size: 602 Bytes

Versions: 2

Compression:

Stored size: 602 Bytes

Contents

module Basket
  class Configuration
    attr_accessor :redis_host, :redis_port, :redis_db, :namespace, :redis_url
    attr_reader :backend

    def initialize
      @redis_host = "127.0.0.1"
      @redis_port = 6379
      @redis_db = 15
      @backend = BackendAdapter::HashBackend
      @namespace = :basket
      @redis_url = nil
    end

    def backend=(backend)
      case backend
      when :hash
        @backend = BackendAdapter::HashBackend
      when :redis
        @backend = BackendAdapter::RedisBackend
      else
        raise Basket::Error, "Unknown Backend"
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
basket-0.0.5 lib/basket/configuration.rb
basket-0.0.4 lib/basket/configuration.rb