Class: Couchbase::Collection::MutationResult
- Inherits:
-
Object
- Object
- Couchbase::Collection::MutationResult
- Defined in:
- lib/couchbase/collection_options.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#cas ⇒ Integer
Holds the CAS value of the document after the mutation.
-
#error ⇒ Error::CouchbaseError?
Error or nil (used in multi-operations like #upsert_multi, #remove_multi).
-
#id ⇒ String?
Identifier of the document (used in multi-operations like #upsert_multi, #remove_multi).
-
#mutation_token ⇒ MutationToken
If returned, holds the mutation token of the document after the mutation.
Instance Method Summary collapse
-
#initialize {|self| ... } ⇒ MutationResult
constructor
A new instance of MutationResult.
-
#success? ⇒ Boolean
True if error was not associated with the result (useful for multi-operations).
Constructor Details
#initialize {|self| ... } ⇒ MutationResult
Returns a new instance of MutationResult.
154 155 156 157 158 |
# File 'lib/couchbase/collection_options.rb', line 154 def initialize @error = nil @id = nil yield self if block_given? end |
Instance Attribute Details
#cas ⇒ Integer
Returns holds the CAS value of the document after the mutation.
135 136 137 |
# File 'lib/couchbase/collection_options.rb', line 135 def cas @cas end |
#error ⇒ Error::CouchbaseError?
Returns error or nil (used in multi-operations like Couchbase::Collection#upsert_multi, Couchbase::Collection#remove_multi).
142 143 144 |
# File 'lib/couchbase/collection_options.rb', line 142 def error @error end |
#id ⇒ String?
Returns identifier of the document (used in multi-operations like Couchbase::Collection#upsert_multi, Couchbase::Collection#remove_multi).
146 147 148 |
# File 'lib/couchbase/collection_options.rb', line 146 def id @id end |
#mutation_token ⇒ MutationToken
Returns if returned, holds the mutation token of the document after the mutation.
138 139 140 |
# File 'lib/couchbase/collection_options.rb', line 138 def mutation_token @mutation_token end |
Instance Method Details
#success? ⇒ Boolean
Returns true if error was not associated with the result (useful for multi-operations).
149 150 151 |
# File 'lib/couchbase/collection_options.rb', line 149 def success? !error end |