Class: Hyrax::Indexer Private

Inherits:
Module
  • Object
show all
Defined in:
lib/hyrax/indexer.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

See Also:

Instance Method Summary collapse

Constructor Details

#initialize(rules) ⇒ Indexer

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Indexer.

Parameters:

  • rules (Hash{Symbol => Symbol})


33
34
35
36
37
38
39
40
41
# File 'lib/hyrax/indexer.rb', line 33

def initialize(rules)
  define_method :to_solr do |*args|
    super(*args).tap do |document|
      rules.each do |index_key, method|
        document[index_key] = resource.try(method)
      end
    end
  end
end