Module: Bones::RPC::ReadPreference::Selectable
- Included in:
- Nearest
- Defined in:
- lib/bones/rpc/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
14 15 16 |
# File 'lib/bones/rpc/read_preference/selectable.rb', line 14 def @tags end |
Instance Method Details
#initialize(tags = nil) ⇒ Object
Instantiate the new taggable read preference.
24 25 26 |
# File 'lib/bones/rpc/read_preference/selectable.rb', line 24 def initialize( = nil) @tags = end |
#query_options(options) ⇒ Hash
Get the provided options as query options for this read preference.
38 39 40 41 42 |
# File 'lib/bones/rpc/read_preference/selectable.rb', line 38 def () [:flags] ||= [] [:flags] |= [ :slave_ok ] end |