Class: Couchbase::Options::UpsertMulti
- Defined in:
- lib/couchbase/options.rb,
/code/couchbase-ruby-client/lib/couchbase/options.rb
Overview
Options for Collection#upsert_multi
Instance Attribute Summary collapse
- #durability_level ⇒ Symbol
- #expiry ⇒ Integer, ...
- #preserve_expiry ⇒ Boolean
- #transcoder ⇒ JsonTranscoder, #encode(Object)
Attributes inherited from Base
#client_context, #parent_span, #retry_strategy, #timeout
Instance Method Summary collapse
-
#initialize(expiry: nil, preserve_expiry: false, transcoder: JsonTranscoder.new, durability_level: :none, replicate_to: :none, persist_to: :none, timeout: nil, retry_strategy: nil, client_context: nil, parent_span: nil) {|| ... } ⇒ UpsertMulti
constructor
Creates an instance of options for Collection#upsert.
- #to_backend ⇒ Object
Constructor Details
#initialize(expiry: nil, preserve_expiry: false, transcoder: JsonTranscoder.new, durability_level: :none, replicate_to: :none, persist_to: :none, timeout: nil, retry_strategy: nil, client_context: nil, parent_span: nil) {|| ... } ⇒ UpsertMulti
Creates an instance of options for Collection#upsert
747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 |
# File 'lib/couchbase/options.rb', line 747 def initialize(expiry: nil, preserve_expiry: false, 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 @preserve_expiry = preserve_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
706 707 708 |
# File 'lib/couchbase/options.rb', line 706 def durability_level @durability_level end |
#expiry ⇒ Integer, ...
704 705 706 |
# File 'lib/couchbase/options.rb', line 704 def expiry @expiry end |
#preserve_expiry ⇒ Boolean
707 708 709 |
# File 'lib/couchbase/options.rb', line 707 def preserve_expiry @preserve_expiry end |
#transcoder ⇒ JsonTranscoder, #encode(Object)
705 706 707 |
# File 'lib/couchbase/options.rb', line 705 def transcoder @transcoder end |
Instance Method Details
#to_backend ⇒ Object
771 772 773 774 775 776 777 778 779 780 |
# File 'lib/couchbase/options.rb', line 771 def to_backend { timeout: Utils::Time.extract_duration(@timeout), expiry: Utils::Time.extract_expiry_time(@expiry), preserve_expiry: @preserve_expiry, durability_level: @durability_level, persist_to: @persist_to, replicate_to: @replicate_to, } end |