Class: Solr::Request::DefaultNodeSelectionStrategy
- Inherits:
-
Object
- Object
- Solr::Request::DefaultNodeSelectionStrategy
- Defined in:
- lib/solr/request/default_node_selection_strategy.rb
Instance Attribute Summary collapse
-
#collection_name ⇒ Object
readonly
Returns the value of attribute collection_name.
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(collection_name) ⇒ DefaultNodeSelectionStrategy
constructor
A new instance of DefaultNodeSelectionStrategy.
Constructor Details
#initialize(collection_name) ⇒ DefaultNodeSelectionStrategy
Returns a new instance of DefaultNodeSelectionStrategy.
10 11 12 |
# File 'lib/solr/request/default_node_selection_strategy.rb', line 10 def initialize(collection_name) @collection_name = collection_name end |
Instance Attribute Details
#collection_name ⇒ Object (readonly)
Returns the value of attribute collection_name.
4 5 6 |
# File 'lib/solr/request/default_node_selection_strategy.rb', line 4 def collection_name @collection_name end |
Class Method Details
.call(collection_name) ⇒ Object
6 7 8 |
# File 'lib/solr/request/default_node_selection_strategy.rb', line 6 def self.call(collection_name) new(collection_name).call end |
Instance Method Details
#call ⇒ Object
14 15 16 |
# File 'lib/solr/request/default_node_selection_strategy.rb', line 14 def call Solr.active_nodes_for(collection: collection_name).shuffle end |