Class: Couchbase::Options::Insert
Overview
Options for Collection#insert
Instance Attribute Summary collapse
Attributes inherited from Base
#client_context, #parent_span, #retry_strategy, #timeout
Instance Method Summary collapse
-
#initialize(expiry: nil, transcoder: JsonTranscoder.new, durability_level: :none, replicate_to: :none, persist_to: :none, timeout: nil, retry_strategy: nil, client_context: nil, parent_span: nil) {|| ... } ⇒ Insert
constructor
Creates an instance of options for Collection#insert.
Constructor Details
#initialize(expiry: nil, transcoder: JsonTranscoder.new, durability_level: :none, replicate_to: :none, persist_to: :none, timeout: nil, retry_strategy: nil, client_context: nil, parent_span: nil) {|| ... } ⇒ Insert
Creates an instance of options for Collection#insert
595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 |
# File 'lib/couchbase/options.rb', line 595 def initialize(expiry: nil, transcoder: JsonTranscoder.new, 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) @expiry = expiry @transcoder = transcoder 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
#durability_level ⇒ Symbol
557 558 559 |
# File 'lib/couchbase/options.rb', line 557 def durability_level @durability_level end |
#expiry ⇒ Integer, ...
555 556 557 |
# File 'lib/couchbase/options.rb', line 555 def expiry @expiry end |
#transcoder ⇒ JsonTranscoder, #encode(Object)
556 557 558 |
# File 'lib/couchbase/options.rb', line 556 def transcoder @transcoder end |