Class: Couchbase::Protostellar::Scope Private
- Inherits:
-
Object
- Object
- Couchbase::Protostellar::Scope
- Defined in:
- lib/couchbase/protostellar/scope.rb
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.
Instance Attribute Summary collapse
- #bucket_name ⇒ Object readonly private
- #name ⇒ Object readonly private
Instance Method Summary collapse
- #collection(name) ⇒ Object private
-
#initialize(client, bucket_name, name) ⇒ Scope
constructor
private
A new instance of Scope.
- #query(statement, options = Couchbase::Options::Query::DEFAULT) ⇒ Object private
- #search ⇒ Object private
- #search_query ⇒ Object private
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.
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_name ⇒ Object (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.
27 28 29 |
# File 'lib/couchbase/protostellar/scope.rb', line 27 def bucket_name @bucket_name end |
#name ⇒ Object (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.
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.
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.
42 43 44 45 46 |
# File 'lib/couchbase/protostellar/scope.rb', line 42 def query(statement, = Couchbase::Options::Query::DEFAULT) req = @query_request_generator.query_request(statement, ) resps = @client.send_request(req) ResponseConverter::Query.to_query_result(resps) end |
#search ⇒ 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.
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_query ⇒ 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.
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 |