Class: Kithe::Indexable::IndexableSettings

Inherits:
Object
  • Object
show all
Defined in:
app/indexing/kithe/indexable.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(solr_url:, writer_class_name:, writer_settings:, model_name_solr_field:, disable_callbacks: false) ⇒ IndexableSettings

Returns a new instance of IndexableSettings.



57
58
59
60
61
62
# File 'app/indexing/kithe/indexable.rb', line 57

def initialize(solr_url:, writer_class_name:, writer_settings:, model_name_solr_field:, 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
end

Instance Attribute Details

#disable_callbacksObject

Returns the value of attribute disable_callbacks.



56
57
58
# File 'app/indexing/kithe/indexable.rb', line 56

def disable_callbacks
  @disable_callbacks
end

#model_name_solr_fieldObject

Returns the value of attribute model_name_solr_field.



56
57
58
# File 'app/indexing/kithe/indexable.rb', line 56

def model_name_solr_field
  @model_name_solr_field
end

#solr_urlObject

Returns the value of attribute solr_url.



56
57
58
# File 'app/indexing/kithe/indexable.rb', line 56

def solr_url
  @solr_url
end

#writer_class_nameObject

Returns the value of attribute writer_class_name.



56
57
58
# File 'app/indexing/kithe/indexable.rb', line 56

def writer_class_name
  @writer_class_name
end

#writer_settingsObject

Use configured solr_url, and merge together with configured writer_settings



66
67
68
# File 'app/indexing/kithe/indexable.rb', line 66

def writer_settings
  @writer_settings
end

Instance Method Details

#writer_classObject

Turn writer_class_name into an actual Class object.



75
76
77
# File 'app/indexing/kithe/indexable.rb', line 75

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`



80
81
82
# File 'app/indexing/kithe/indexable.rb', line 80

def writer_instance!(additional_settings = {})
  writer_class.new(writer_settings.merge(additional_settings))
end