Class: Couchbase::Collection::ScanResult
- Inherits:
-
Object
- Object
- Couchbase::Collection::ScanResult
- Defined in:
- lib/couchbase/collection_options.rb,
/Users/sergey.auseyau/code/couchbase-ruby-client/lib/couchbase/collection_options.rb more...
Instance Attribute Summary collapse
-
#cas ⇒ Integer?
Holds the CAS value of the fetched document.
-
#expiry ⇒ Integer?
The expiration if fetched and present.
-
#id ⇒ String
Identifier of the document.
-
#id_only ⇒ Boolean
Whether only ids are returned from this scan.
-
#transcoder ⇒ JsonTranscoder, ...
The default transcoder which should be used.
Instance Method Summary collapse
-
#content(transcoder = self.transcoder) ⇒ Object?
Decodes the content of the document using given (or default transcoder).
-
#initialize(id:, id_only:, cas: nil, expiry: nil, encoded: nil, flags: nil, transcoder: JsonTranscoder.new) {|_self| ... } ⇒ ScanResult
constructor
A new instance of ScanResult.
Constructor Details
#initialize(id:, id_only:, cas: nil, expiry: nil, encoded: nil, flags: nil, transcoder: JsonTranscoder.new) {|_self| ... } ⇒ ScanResult
Returns a new instance of ScanResult.
339 340 341 342 343 344 345 346 347 348 349 |
# File 'lib/couchbase/collection_options.rb', line 339 def initialize(id:, id_only:, cas: nil, expiry: nil, encoded: nil, flags: nil, transcoder: JsonTranscoder.new) @id = id @id_only = id_only @cas = cas @expiry = expiry @encoded = encoded @flags = flags @transcoder = transcoder yield self if block_given? end |
Instance Attribute Details
#cas ⇒ Integer?
Returns holds the CAS value of the fetched document.
330 331 332 |
# File 'lib/couchbase/collection_options.rb', line 330 def cas @cas end |
#expiry ⇒ Integer?
Returns the expiration if fetched and present.
333 334 335 |
# File 'lib/couchbase/collection_options.rb', line 333 def expiry @expiry end |
#id ⇒ String
Returns identifier of the document.
324 325 326 |
# File 'lib/couchbase/collection_options.rb', line 324 def id @id end |
#id_only ⇒ Boolean
Returns whether only ids are returned from this scan.
327 328 329 |
# File 'lib/couchbase/collection_options.rb', line 327 def id_only @id_only end |
#transcoder ⇒ JsonTranscoder, ...
Returns The default transcoder which should be used.
337 338 339 |
# File 'lib/couchbase/collection_options.rb', line 337 def transcoder @transcoder end |
Instance Method Details
#content(transcoder = self.transcoder) ⇒ Object?
Decodes the content of the document using given (or default transcoder)
356 357 358 359 360 |
# File 'lib/couchbase/collection_options.rb', line 356 def content(transcoder = self.transcoder) return nil if @encoded.nil? transcoder ? transcoder.decode(@encoded, @flags) : @encoded end |