Class: SolrCloud::Configset
- Inherits:
-
Object
- Object
- SolrCloud::Configset
- Defined in:
- lib/solr_cloud/configset.rb
Overview
A configset can’t do much by itself, other than try to delete itself and throw an error if that’s an illegal operation (because a collection is using it)
Instance Attribute Summary collapse
-
#connection ⇒ Connection
readonly
The connection object used to build this configset object.
-
#name ⇒ String
readonly
The name of this configset.
Instance Method Summary collapse
-
#delete! ⇒ Object
Delete this configset.
-
#in_use? ⇒ Boolean
Are there any collections currently using this configset?.
-
#initialize(name:, connection:) ⇒ Configset
constructor
A new instance of Configset.
- #inspect ⇒ Object (also: #to_s)
- #pretty_print(q) ⇒ Object
-
#used_by ⇒ Array<Collection>
Which collections use this configset?.
Constructor Details
#initialize(name:, connection:) ⇒ Configset
Returns a new instance of Configset.
17 18 19 20 |
# File 'lib/solr_cloud/configset.rb', line 17 def initialize(name:, connection:) @name = name @connection = connection end |
Instance Attribute Details
#connection ⇒ Connection (readonly)
Returns the connection object used to build this configset object.
15 16 17 |
# File 'lib/solr_cloud/configset.rb', line 15 def connection @connection end |
#name ⇒ String (readonly)
Returns the name of this configset.
12 13 14 |
# File 'lib/solr_cloud/configset.rb', line 12 def name @name end |
Instance Method Details
#delete! ⇒ Object
Delete this configset.
25 26 27 28 |
# File 'lib/solr_cloud/configset.rb', line 25 def delete! connection.delete_configset(name) connection end |
#in_use? ⇒ Boolean
Are there any collections currently using this configset?
38 39 40 |
# File 'lib/solr_cloud/configset.rb', line 38 def in_use? !used_by.empty? end |
#inspect ⇒ Object Also known as: to_s
42 43 44 |
# File 'lib/solr_cloud/configset.rb', line 42 def inspect "<#{self.class.name} '#{name}' at #{connection.url}>" end |
#pretty_print(q) ⇒ Object
48 49 50 |
# File 'lib/solr_cloud/configset.rb', line 48 def pretty_print(q) q.text inspect end |
#used_by ⇒ Array<Collection>
Which collections use this configset?
32 33 34 |
# File 'lib/solr_cloud/configset.rb', line 32 def used_by connection.only_collections.select { |coll| coll.configset.name == name } end |