Class: Couchbase::Options::Decrement
- Defined in:
- lib/couchbase/options.rb,
/Users/sergey.auseyau/code/couchbase-ruby-client/lib/couchbase/options.rb more...
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
1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 |
# File 'lib/couchbase/options.rb', line 1240 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 = Utils::Time.extract_expiry_time(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
1198 1199 1200 |
# File 'lib/couchbase/options.rb', line 1198 def delta @delta end |
#durability_level ⇒ Symbol
1201 1202 1203 |
# File 'lib/couchbase/options.rb', line 1201 def durability_level @durability_level end |
#expiry ⇒ Integer, #in_seconds
1200 1201 1202 |
# File 'lib/couchbase/options.rb', line 1200 def expiry @expiry end |
#initial ⇒ Integer
1199 1200 1201 |
# File 'lib/couchbase/options.rb', line 1199 def initial @initial end |