Class: Mongo::WriteConcern::Base
- Inherits:
-
Object
- Object
- Mongo::WriteConcern::Base
- Defined in:
- lib/mongo/write_concern/base.rb
Overview
Defines common behavior for write concerns.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#options ⇒ Hash
readonly
The write concern options.
Instance Method Summary collapse
-
#acknowledged? ⇒ true, false
Is this write concern acknowledged.
-
#initialize(options) ⇒ Base
constructor
private
Instantiate a new write concern given the options.
Constructor Details
#initialize(options) ⇒ Base
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.
Instantiate a new write concern given the options.
45 46 47 48 |
# File 'lib/mongo/write_concern/base.rb', line 45 def initialize() opts = Options::Mapper.transform_keys_to_symbols() @options = Options::Mapper.transform_values_to_strings(opts).freeze end |
Instance Attribute Details
#options ⇒ Hash (readonly)
Returns The write concern options.
24 25 26 |
# File 'lib/mongo/write_concern/base.rb', line 24 def @options end |
Instance Method Details
#acknowledged? ⇒ true, false
Is this write concern acknowledged.
58 59 60 |
# File 'lib/mongo/write_concern/base.rb', line 58 def acknowledged? !!get_last_error end |