Class: Couchbase::Collection::MutateInResult

Inherits:
MutationResult show all
Defined in:
lib/couchbase/collection_options.rb

Instance Attribute Summary collapse

Attributes inherited from MutationResult

#cas, #error, #id, #mutation_token

Instance Method Summary collapse

Methods inherited from MutationResult

#success?

Constructor Details

#initialize {|self| ... } ⇒ MutateInResult

Returns a new instance of MutateInResult.

Yield Parameters:



262
263
264
265
# File 'lib/couchbase/collection_options.rb', line 262

def initialize
  super
  yield self if block_given?
end

Instance Attribute Details

#deletedObject

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.



284
285
286
# File 'lib/couchbase/collection_options.rb', line 284

def deleted
  @deleted
end

#encodedArray<SubDocumentField>

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 holds the encoded subdocument responses.

Returns:



269
270
271
# File 'lib/couchbase/collection_options.rb', line 269

def encoded
  @encoded
end

#transcoderJsonTranscoder

Returns The default transcoder which should be used.

Returns:



272
273
274
# File 'lib/couchbase/collection_options.rb', line 272

def transcoder
  @transcoder
end

Instance Method Details

#content(path_or_index, transcoder = self.transcoder) ⇒ Object

Decodes the content at the given index

Parameters:

  • path_or_index (Integer, String)

    the index (or path) of the subdocument value to decode

Returns:

  • (Object)

    the decoded



256
257
258
259
# File 'lib/couchbase/collection_options.rb', line 256

def content(path_or_index, transcoder = self.transcoder)
  field = get_field_at_index(path_or_index)
  transcoder.decode(field.value, :json)
end

#deleted?Boolean

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 true if the document is a tombstone (created in deleted state).

Returns:

  • (Boolean)

    true if the document is a tombstone (created in deleted state)

See Also:



279
280
281
# File 'lib/couchbase/collection_options.rb', line 279

def deleted?
  @deleted
end