Sha256: c8af8c64880d3be4edc0a65887134391771ad80d98d6f101d4d6a30c533660a5
Contents?: true
Size: 907 Bytes
Versions: 17
Compression:
Stored size: 907 Bytes
Contents
# encoding: utf-8 module Moped module WriteConcern # Propagating write concerns piggyback a getlasterror command to any write # operation with the necessary options. # # @since 2.0.0 class Propagate # @!attribute operation # @return [ Hash ] The gle operation. attr_reader :operation # Initialize the propagating write concern. # # @example Instantiate the write concern. # Moped::WriteConcern::Propagate.new(w: 3) # # @param [ Hash ] operation The operation to execute. # # @since 2.0.0 def initialize(options) @operation = { getlasterror: 1 }.merge!(normalize(options)) end private def normalize(options) opts = {} options.each do |key, value| opts[key] = value.is_a?(Symbol) ? value.to_s : value end opts end end end end
Version data entries
17 entries across 17 versions & 2 rubygems