Class: Kithe::IndexableSettings
- Inherits:
-
Object
- Object
- Kithe::IndexableSettings
- Defined in:
- lib/kithe/indexable_settings.rb
Instance Attribute Summary collapse
-
#disable_callbacks ⇒ Object
Returns the value of attribute disable_callbacks.
-
#model_name_solr_field ⇒ Object
Returns the value of attribute model_name_solr_field.
-
#solr_id_value_attribute ⇒ Object
Returns the value of attribute solr_id_value_attribute.
-
#solr_url ⇒ Object
Returns the value of attribute solr_url.
-
#writer_class_name ⇒ Object
Returns the value of attribute writer_class_name.
-
#writer_settings ⇒ Object
Use configured solr_url, and merge together with configured writer_settings.
Instance Method Summary collapse
-
#initialize(solr_url:, writer_class_name:, writer_settings:, model_name_solr_field:, solr_id_value_attribute:, disable_callbacks: false) ⇒ IndexableSettings
constructor
A new instance of IndexableSettings.
-
#writer_class ⇒ Object
Turn writer_class_name into an actual Class object.
-
#writer_instance!(additional_settings = {}) ⇒ Object
Instantiate a new writer based on ‘writer_class_name` and `writer_settings`.
Constructor Details
#initialize(solr_url:, writer_class_name:, writer_settings:, model_name_solr_field:, solr_id_value_attribute:, disable_callbacks: false) ⇒ IndexableSettings
Returns a new instance of IndexableSettings.
5 6 7 8 9 10 11 12 |
# File 'lib/kithe/indexable_settings.rb', line 5 def initialize(solr_url:, writer_class_name:, writer_settings:, model_name_solr_field:, solr_id_value_attribute:, disable_callbacks: false) @solr_url = solr_url @writer_class_name = writer_class_name @writer_settings = writer_settings @model_name_solr_field = model_name_solr_field @solr_id_value_attribute = solr_id_value_attribute end |
Instance Attribute Details
#disable_callbacks ⇒ Object
Returns the value of attribute disable_callbacks.
3 4 5 |
# File 'lib/kithe/indexable_settings.rb', line 3 def disable_callbacks @disable_callbacks end |
#model_name_solr_field ⇒ Object
Returns the value of attribute model_name_solr_field.
3 4 5 |
# File 'lib/kithe/indexable_settings.rb', line 3 def model_name_solr_field @model_name_solr_field end |
#solr_id_value_attribute ⇒ Object
Returns the value of attribute solr_id_value_attribute.
3 4 5 |
# File 'lib/kithe/indexable_settings.rb', line 3 def solr_id_value_attribute @solr_id_value_attribute end |
#solr_url ⇒ Object
Returns the value of attribute solr_url.
3 4 5 |
# File 'lib/kithe/indexable_settings.rb', line 3 def solr_url @solr_url end |
#writer_class_name ⇒ Object
Returns the value of attribute writer_class_name.
3 4 5 |
# File 'lib/kithe/indexable_settings.rb', line 3 def writer_class_name @writer_class_name end |
#writer_settings ⇒ Object
Use configured solr_url, and merge together with configured writer_settings
16 17 18 |
# File 'lib/kithe/indexable_settings.rb', line 16 def writer_settings @writer_settings end |
Instance Method Details
#writer_class ⇒ Object
Turn writer_class_name into an actual Class object.
25 26 27 |
# File 'lib/kithe/indexable_settings.rb', line 25 def writer_class writer_class_name.constantize end |
#writer_instance!(additional_settings = {}) ⇒ Object
Instantiate a new writer based on ‘writer_class_name` and `writer_settings`
30 31 32 |
# File 'lib/kithe/indexable_settings.rb', line 30 def writer_instance!(additional_settings = {}) writer_class.new(writer_settings.merge(additional_settings)) end |