Class: Couchbase::Collection::GetResult

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

Direct Known Subclasses

GetReplicaResult

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of GetResult.

Yield Parameters:

[View source]

107
108
109
# File 'lib/couchbase/collection_options.rb', line 107

def initialize
  yield self if block_given?
end

Instance Attribute Details

#casInteger

Returns holds the CAS value of the fetched document.

Returns:

  • (Integer)

    holds the CAS value of the fetched document


88
89
90
# File 'lib/couchbase/collection_options.rb', line 88

def cas
  @cas
end

#expiryInteger

Returns the expiration if fetched and present.

Returns:

  • (Integer)

    the expiration if fetched and present


91
92
93
# File 'lib/couchbase/collection_options.rb', line 91

def expiry
  @expiry
end

#transcoderJsonTranscoder

Returns The default transcoder which should be used.

Returns:


116
117
118
# File 'lib/couchbase/collection_options.rb', line 116

def transcoder
  @transcoder
end

Instance Method Details

#content(transcoder = self.transcoder) ⇒ Object

Decodes the content of the document using given (or default transcoder)

Parameters:

  • transcoder (JsonTranscoder) (defaults to: self.transcoder)

    custom transcoder

Returns:

  • (Object)
[View source]

102
103
104
# File 'lib/couchbase/collection_options.rb', line 102

def content(transcoder = self.transcoder)
  transcoder.decode(@encoded, @flags)
end