Module: Moped::WriteConcern
- Extended by:
- WriteConcern
- Included in:
- WriteConcern
- Defined in:
- lib/moped/write_concern.rb,
lib/moped/write_concern/propagate.rb,
lib/moped/write_concern/unverified.rb
Overview
Provides behaviour on getting the correct write concern for an option.
Defined Under Namespace
Classes: Propagate, Unverified
Instance Method Summary collapse
-
#get(value) ⇒ Unverified, Propagate
Get the corresponding write concern for the provided value.
Instance Method Details
#get(value) ⇒ Unverified, Propagate
Get the corresponding write concern for the provided value. If the value is unverified we get that concern, otherwise we get propagate.
24 25 26 27 28 29 30 31 |
# File 'lib/moped/write_concern.rb', line 24 def get(value) propagate = value[:w] || value["w"] if propagate == 0 || propagate == -1 Unverified.new else Propagate.new(value) end end |