Class: Couchbase::Operations::DesignDocs::DesignDocAccess

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

Instance Method Summary collapse

Constructor Details

#initialize(bucket) ⇒ DesignDocAccess

Returns a new instance of DesignDocAccess.



25
26
27
# File 'lib/couchbase/operations/design_docs.rb', line 25

def initialize(bucket)
  @bucket = bucket
end

Instance Method Details

#[](name) ⇒ Object



29
30
31
32
33
34
# File 'lib/couchbase/operations/design_docs.rb', line 29

def [](name)
  doc = @bucket.client.getDesignDocument(name)
  Couchbase::DesignDoc.new(@bucket, doc)
rescue Java::ComCouchbaseClientProtocolViews::InvalidViewException
  nil
end