lib/basket/configuration.rb in basket-0.0.2 vs lib/basket/configuration.rb in basket-0.0.3
- old
+ new
@@ -1,7 +1,25 @@
module Basket
class Configuration
- def queue_collection
- @queue_collection ||= Basket::QueueCollection.new
+ attr_accessor :redis_host, :redis_port, :redis_db, :namespace
+ attr_reader :backend
+
+ def initialize
+ @redis_host = "127.0.0.1"
+ @redis_port = 6379
+ @redis_db = 15
+ @backend = BackendAdapter::HashBackend
+ @namespace = :basket
+ 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