Class: Valkyrie::Persistence::Solr::CompositeIndexer::Instance

Inherits:
Object
  • Object
show all
Defined in:
lib/valkyrie/persistence/solr/composite_indexer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(indexers, resource:) ⇒ Instance

Returns a new instance of Instance.



19
20
21
22
# File 'lib/valkyrie/persistence/solr/composite_indexer.rb', line 19

def initialize(indexers, resource:)
  @resource = resource
  @indexers = indexers.map { |i| i.new(resource: resource) }
end

Instance Attribute Details

#indexersObject (readonly)

Returns the value of attribute indexers.



18
19
20
# File 'lib/valkyrie/persistence/solr/composite_indexer.rb', line 18

def indexers
  @indexers
end

#resourceObject (readonly)

Returns the value of attribute resource.



18
19
20
# File 'lib/valkyrie/persistence/solr/composite_indexer.rb', line 18

def resource
  @resource
end

Instance Method Details

#to_solrObject



24
25
26
# File 'lib/valkyrie/persistence/solr/composite_indexer.rb', line 24

def to_solr
  indexers.map(&:to_solr).inject({}, &:merge)
end