Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Sep 7th, 2012  |  syntax: None  |  size: 0.30 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. module Couch
  2.  
  3.   class << self
  4.  
  5.     def url
  6.       ENV['COUCHBASE_URL'] || "http://127.0.0.1:8091/pools/default"
  7.     end
  8.  
  9.     def client(options = {})
  10.       bucket = options.delete(:bucket) || "default"
  11.       @clients ||= {}
  12.       @clients[bucket] ||= Couchbase.new(url, :bucket => bucket)
  13.     end
  14.  
  15.   end
  16.  
  17. end