Class: Couchbase::Options::MutateIn
- Defined in:
- lib/couchbase/options.rb
Overview
Options for Collection#mutate_in
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.
MutateIn.new.freeze
Instance Attribute Summary collapse
- #access_deleted ⇒ Boolean private
- #cas ⇒ Integer?
- #create_as_deleted ⇒ Boolean private
- #durability_level ⇒ Symbol
- #expiry ⇒ Integer, ...
- #preserve_expiry ⇒ Boolean
- #store_semantics ⇒ Symbol
- #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, store_semantics: :replace, cas: nil, access_deleted: false, create_as_deleted: false, durability_level: :none, replicate_to: :none, persist_to: :none, transcoder: JsonTranscoder.new, timeout: nil, retry_strategy: nil, client_context: nil, parent_span: nil) {|| ... } ⇒ MutateIn
constructor
Creates an instance of options for Collection#mutate_in.
- #to_backend ⇒ Object private
Constructor Details
#initialize(expiry: nil, preserve_expiry: false, store_semantics: :replace, cas: nil, access_deleted: false, create_as_deleted: false, durability_level: :none, replicate_to: :none, persist_to: :none, transcoder: JsonTranscoder.new, timeout: nil, retry_strategy: nil, client_context: nil, parent_span: nil) {|| ... } ⇒ MutateIn
Creates an instance of options for Collection#mutate_in
929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 |
# File 'lib/couchbase/options.rb', line 929 def initialize(expiry: nil, preserve_expiry: false, store_semantics: :replace, cas: nil, access_deleted: false, create_as_deleted: false, durability_level: :none, replicate_to: :none, persist_to: :none, transcoder: JsonTranscoder.new, 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 @store_semantics = store_semantics @cas = cas @access_deleted = access_deleted @create_as_deleted = create_as_deleted 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 @transcoder = transcoder yield self if block_given? end |
Instance Attribute Details
#access_deleted ⇒ Boolean
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.
979 980 981 |
# File 'lib/couchbase/options.rb', line 979 def access_deleted @access_deleted end |
#cas ⇒ Integer?
879 880 881 |
# File 'lib/couchbase/options.rb', line 879 def cas @cas end |
#create_as_deleted ⇒ Boolean
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.
983 984 985 |
# File 'lib/couchbase/options.rb', line 983 def create_as_deleted @create_as_deleted end |
#durability_level ⇒ Symbol
880 881 882 |
# File 'lib/couchbase/options.rb', line 880 def durability_level @durability_level end |
#expiry ⇒ Integer, ...
877 878 879 |
# File 'lib/couchbase/options.rb', line 877 def expiry @expiry end |
#preserve_expiry ⇒ Boolean
882 883 884 |
# File 'lib/couchbase/options.rb', line 882 def preserve_expiry @preserve_expiry end |
#store_semantics ⇒ Symbol
878 879 880 |
# File 'lib/couchbase/options.rb', line 878 def store_semantics @store_semantics end |
#transcoder ⇒ JsonTranscoder, #encode(Object)
881 882 883 |
# File 'lib/couchbase/options.rb', line 881 def transcoder @transcoder 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.
962 963 964 965 966 967 968 969 970 971 972 973 974 975 |
# File 'lib/couchbase/options.rb', line 962 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, cas: @cas, store_semantics: @store_semantics, access_deleted: @access_deleted, create_as_deleted: @create_as_deleted, } end |