Class: Couchbase::Protostellar::BinaryCollection Private

Inherits:
Object
  • Object
show all
Defined in:
lib/couchbase/protostellar/binary_collection.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 Method Summary collapse

Constructor Details

#initialize(collection) ⇒ BinaryCollection

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 BinaryCollection.



24
25
26
27
28
# File 'lib/couchbase/protostellar/binary_collection.rb', line 24

def initialize(collection)
  @collection = collection
  @client = collection.instance_variable_get(:@client)
  @kv_request_generator = collection.instance_variable_get(:@kv_request_generator)
end

Instance Method Details

#append(id, content, options = Options::Append::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.



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

def append(id, content, options = Options::Append::DEFAULT)
  req = @kv_request_generator.append_request(id, content, options)
  resp = @client.send_request(req)
  ResponseConverter::KV.to_mutation_result(resp)
end

#decrement(id, options = Options::Decrement::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.



48
49
50
51
52
# File 'lib/couchbase/protostellar/binary_collection.rb', line 48

def decrement(id, options = Options::Decrement::DEFAULT)
  req = @kv_request_generator.decrement_request(id, options)
  resp = @client.send_request(req)
  ResponseConverter::KV.to_counter_result(resp)
end

#increment(id, options = Options::Increment::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/binary_collection.rb', line 42

def increment(id, options = Options::Increment::DEFAULT)
  req = @kv_request_generator.increment_request(id, options)
  resp = @client.send_request(req)
  ResponseConverter::KV.to_counter_result(resp)
end

#prepend(id, content, options = Options::Prepend::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.



36
37
38
39
40
# File 'lib/couchbase/protostellar/binary_collection.rb', line 36

def prepend(id, content, options = Options::Prepend::DEFAULT)
  req = @kv_request_generator.prepend_request(id, content, options)
  resp = @client.send_request(req)
  ResponseConverter::KV.to_mutation_result(resp)
end