Class: Couchbase::Options::Prepend
- Defined in:
- lib/couchbase/options.rb
Overview
Options for BinaryCollection#prepend
Constant Summary collapse
- DEFAULT =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Prepend.new.freeze
Instance Attribute Summary collapse
Attributes inherited from Base
#client_context, #parent_span, #retry_strategy, #timeout
Instance Method Summary collapse
-
#initialize(cas: nil, durability_level: :none, replicate_to: :none, persist_to: :none, timeout: nil, retry_strategy: nil, client_context: nil, parent_span: nil) {|self| ... } ⇒ Prepend
constructor
Creates an instance of options for BinaryCollection#prepend.
- #to_backend ⇒ Object private
Constructor Details
#initialize(cas: nil, durability_level: :none, replicate_to: :none, persist_to: :none, timeout: nil, retry_strategy: nil, client_context: nil, parent_span: nil) {|self| ... } ⇒ Prepend
Creates an instance of options for BinaryCollection#prepend
1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 |
# File 'lib/couchbase/options.rb', line 1297 def initialize(cas: nil, durability_level: :none, replicate_to: :none, persist_to: :none, timeout: nil, retry_strategy: nil, client_context: nil, parent_span: nil) super(timeout: timeout, retry_strategy: retry_strategy, client_context: client_context, parent_span: parent_span) @cas = cas if durability_level != :none && (replicate_to != :none || persist_to != :none) raise ArgumentError, "durability_level conflicts with replicate_to and persist_to options" end @durability_level = durability_level @replicate_to = replicate_to @persist_to = persist_to yield self if block_given? end |
Instance Attribute Details
#cas ⇒ Integer
1257 1258 1259 |
# File 'lib/couchbase/options.rb', line 1257 def cas @cas end |
#durability_level ⇒ Symbol
1258 1259 1260 |
# File 'lib/couchbase/options.rb', line 1258 def durability_level @durability_level end |
#persist_to ⇒ Symbol
1260 1261 1262 |
# File 'lib/couchbase/options.rb', line 1260 def persist_to @persist_to end |
#replicate_to ⇒ Symbol
1259 1260 1261 |
# File 'lib/couchbase/options.rb', line 1259 def replicate_to @replicate_to end |
Instance Method Details
#to_backend ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
1319 1320 1321 1322 1323 1324 1325 1326 1327 |
# File 'lib/couchbase/options.rb', line 1319 def to_backend { timeout: Utils::Time.extract_duration(@timeout), cas: @cas, durability_level: @durability_level, persist_to: @persist_to, replicate_to: @replicate_to, } end |