Class: Couchbase::Protostellar::Scope Private

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

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

API:

  • private

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client, bucket_name, name) ⇒ Scope

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Scope.

API:

  • private



30
31
32
33
34
35
36
# File 'lib/couchbase/protostellar/scope.rb', line 30

def initialize(client, bucket_name, name)
  @client = client
  @bucket_name = bucket_name
  @name = name

  @query_request_generator = RequestGenerator::Query.new(bucket_name: @bucket_name, scope_name: @name)
end

Instance Attribute Details

#bucket_nameObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

API:

  • private



27
28
29
# File 'lib/couchbase/protostellar/scope.rb', line 27

def bucket_name
  @bucket_name
end

#nameObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

API:

  • private



28
29
30
# File 'lib/couchbase/protostellar/scope.rb', line 28

def name
  @name
end

Instance Method Details

#collection(name) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

API:

  • private



38
39
40
# File 'lib/couchbase/protostellar/scope.rb', line 38

def collection(name)
  Collection.new(@client, @bucket_name, @name, name)
end

#query(statement, options = Couchbase::Options::Query::DEFAULT) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

API:

  • private



42
43
44
45
46
# File 'lib/couchbase/protostellar/scope.rb', line 42

def query(statement, options = Couchbase::Options::Query::DEFAULT)
  req = @query_request_generator.query_request(statement, options)
  resps = @client.send_request(req)
  ResponseConverter::Query.to_query_result(resps)
end

#searchObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Raises:

API:

  • private



52
53
54
# File 'lib/couchbase/protostellar/scope.rb', line 52

def search(...)
  raise Error::FeatureNotAvailable, "scope search not supported in #{Protostellar::NAME} mode"
end

#search_indexesObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Raises:

API:

  • private



56
57
58
# File 'lib/couchbase/protostellar/scope.rb', line 56

def search_indexes(...)
  raise Error::FeatureNotAvailable, "scope search indexes not supported in #{Protostellar::NAME} mode"
end

#search_queryObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Raises:

API:

  • private



48
49
50
# File 'lib/couchbase/protostellar/scope.rb', line 48

def search_query(...)
  raise Error::FeatureNotAvailable, "scope search not supported in #{Protostellar::NAME} mode"
end