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:



260
261
262
263
# File 'lib/couchbase/collection_options.rb', line 260

def initialize
  super
  yield self if block_given?
end

Instance Attribute Details

#transcoderJsonTranscoder

Returns The default transcoder which should be used.

Returns:



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

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



254
255
256
257
# File 'lib/couchbase/collection_options.rb', line 254

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