Module: Moped::ReadPreference::Selectable
- Includes:
- Moped::Retryable
- Included in:
- Nearest, Primary, PrimaryPreferred, Secondary, SecondaryPreferred
- Defined in:
- lib/moped/read_preference/selectable.rb
Overview
Provides the shared behaviour for read preferences that can filter by a tag set or add query options.
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#initialize(tags = nil) ⇒ Object
Instantiate the new taggable read preference.
-
#query_options(options) ⇒ Hash
Get the provided options as query options for this read preference.
Instance Attribute Details
#tags ⇒ Object
15 16 17 |
# File 'lib/moped/read_preference/selectable.rb', line 15 def @tags end |
Instance Method Details
#initialize(tags = nil) ⇒ Object
Instantiate the new taggable read preference.
25 26 27 |
# File 'lib/moped/read_preference/selectable.rb', line 25 def initialize( = nil) @tags = end |
#query_options(options) ⇒ Hash
Get the provided options as query options for this read preference.
39 40 41 42 43 |
# File 'lib/moped/read_preference/selectable.rb', line 39 def () [:flags] ||= [] [:flags] |= [ :slave_ok ] end |