Class: Couchbase::Collection::MutateInResult

Inherits:
MutationResult show all
Defined in:
lib/couchbase/collection_options.rb,
/Users/sergey.auseyau/code/couchbase-ruby-client/lib/couchbase/collection_options.rb
more...

Instance Attribute Summary collapse

Attributes inherited from MutationResult

#cas, #error, #mutation_token

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of MutateInResult.

Yield Parameters:

[View source]

212
213
214
215
# File 'lib/couchbase/collection_options.rb', line 212

def initialize
  super
  yield self if block_given?
end

Instance Attribute Details

#deletedObject

Returns the value of attribute deleted.


209
210
211
# File 'lib/couchbase/collection_options.rb', line 209

def deleted
  @deleted
end

#transcoderJsonTranscoder

Returns The default transcoder which should be used.

Returns:


236
237
238
# File 'lib/couchbase/collection_options.rb', line 236

def transcoder
  @transcoder
end

Instance Method Details

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

Decodes the content at the given index

Parameters:

  • index (Integer)

    the index of the subdocument value to decode

Returns:

  • (Object)

    the decoded

[View source]

193
194
195
196
197
198
199
200
# File 'lib/couchbase/collection_options.rb', line 193

def content(index, transcoder = self.transcoder)
  field = get_field_at_index(index)
  if field.type == :counter
    field.value
  else
    transcoder.decode(field.value, :json)
  end
end

#deleted?Boolean

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:

[View source]

205
206
207
# File 'lib/couchbase/collection_options.rb', line 205

def deleted?
  @deleted
end