Class: Couchbase::Cluster

Inherits:
Object
  • Object
show all
Defined in:
lib/couchbase/cluster.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hosts = 'localhost') ⇒ Cluster



26
27
28
# File 'lib/couchbase/cluster.rb', line 26

def initialize(hosts = 'localhost')
  @cluster = CouchbaseCluster.create(hosts)
end

Instance Attribute Details

#clusterObject (readonly)

Returns the value of attribute cluster.



24
25
26
# File 'lib/couchbase/cluster.rb', line 24

def cluster
  @cluster
end

Instance Method Details

#disconnectObject



34
35
36
# File 'lib/couchbase/cluster.rb', line 34

def disconnect
  @cluster.disconnect
end

#open_bucket(name = 'default', password = '') ⇒ Object



30
31
32
# File 'lib/couchbase/cluster.rb', line 30

def open_bucket(name = 'default', password = '')
  Bucket.new(@cluster.open_bucket(name, password))
end