Class: Couchbase::Collection::GetResult
- Inherits:
-
Object
- Object
- Couchbase::Collection::GetResult
- Extended by:
- Gem::Deprecate
- Defined in:
- lib/couchbase/collection_options.rb,
/Users/sergey.auseyau/code/couchbase-ruby-client/lib/couchbase/collection_options.rb more...
Direct Known Subclasses
Instance Attribute Summary collapse
-
#cas ⇒ Integer
Holds the CAS value of the fetched document.
-
#expiry ⇒ Integer
deprecated
Deprecated.
Use #expiry_time
-
#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).
-
#expiry_time ⇒ Time
Time when the document will expire.
-
#initialize {|self| ... } ⇒ GetResult
constructor
A new instance of GetResult.
Constructor Details
#initialize {|self| ... } ⇒ GetResult
Returns a new instance of GetResult.
119 120 121 122 |
# File 'lib/couchbase/collection_options.rb', line 119 def initialize @expiry = nil yield self if block_given? end |
Instance Attribute Details
#cas ⇒ Integer
Returns holds the CAS value of the fetched document.
95 96 97 |
# File 'lib/couchbase/collection_options.rb', line 95 def cas @cas end |
#expiry ⇒ Integer
Deprecated.
Use #expiry_time
Returns the expiration if fetched and present.
133 134 135 |
# File 'lib/couchbase/collection_options.rb', line 133 def expiry @expiry end |
#transcoder ⇒ JsonTranscoder
Returns The default transcoder which should be used.
129 130 131 |
# File 'lib/couchbase/collection_options.rb', line 129 def transcoder @transcoder end |
Instance Method Details
#content(transcoder = self.transcoder) ⇒ Object
Decodes the content of the document using given (or default transcoder)
109 110 111 |
# File 'lib/couchbase/collection_options.rb', line 109 def content(transcoder = self.transcoder) transcoder.decode(@encoded, @flags) end |
#expiry_time ⇒ Time
Returns time when the document will expire.
114 115 116 |
# File 'lib/couchbase/collection_options.rb', line 114 def expiry_time Time.at(@expiry) if @expiry end |