Class: Couchbase::Options::Decrement
- Defined in:
- lib/couchbase/options.rb
Overview
Options for BinaryCollection#decrement
Instance Attribute Summary collapse
Attributes inherited from Base
#client_context, #parent_span, #retry_strategy, #timeout
Instance Method Summary collapse
-
#initialize(delta: 1, initial: nil, expiry: nil, durability_level: :none, replicate_to: :none, persist_to: :none, timeout: nil, retry_strategy: nil, client_context: nil, parent_span: nil) {|self| ... } ⇒ Decrement
constructor
Creates an instance of options for BinaryCollection#decrement.
Constructor Details
#initialize(delta: 1, initial: nil, expiry: nil, durability_level: :none, replicate_to: :none, persist_to: :none, timeout: nil, retry_strategy: nil, client_context: nil, parent_span: nil) {|self| ... } ⇒ Decrement
Creates an instance of options for BinaryCollection#decrement
1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 |
# File 'lib/couchbase/options.rb', line 1471 def initialize(delta: 1, initial: nil, expiry: nil, durability_level: :none, replicate_to: :none, persist_to: :none, timeout: nil, retry_strategy: nil, client_context: nil, parent_span: nil) raise ArgumentError, "the delta cannot be less than 0" if delta.negative? super(timeout: timeout, retry_strategy: retry_strategy, client_context: client_context, parent_span: parent_span) @delta = delta @initial = initial @expiry = expiry if durability_level != :none && (replicate_to != :none || persist_to != :none) raise ArgumentError, "durability_level conflicts with replicate_to and persist_to options" end @persist_to = persist_to @replicate_to = replicate_to @durability_level = durability_level yield self if block_given? end |
Instance Attribute Details
#delta ⇒ Integer
1429 1430 1431 |
# File 'lib/couchbase/options.rb', line 1429 def delta @delta end |
#durability_level ⇒ Symbol
1432 1433 1434 |
# File 'lib/couchbase/options.rb', line 1432 def durability_level @durability_level end |
#expiry ⇒ Integer, #in_seconds
1431 1432 1433 |
# File 'lib/couchbase/options.rb', line 1431 def expiry @expiry end |
#initial ⇒ Integer
1430 1431 1432 |
# File 'lib/couchbase/options.rb', line 1430 def initial @initial end |