Class: Valkyrie::Persistence::Solr::CompositeIndexer::Instance
- Inherits:
-
Object
- Object
- Valkyrie::Persistence::Solr::CompositeIndexer::Instance
- Defined in:
- lib/valkyrie/persistence/solr/composite_indexer.rb
Instance Attribute Summary collapse
-
#indexers ⇒ Object
readonly
Returns the value of attribute indexers.
-
#resource ⇒ Object
readonly
Returns the value of attribute resource.
Instance Method Summary collapse
-
#initialize(indexers, resource:) ⇒ Instance
constructor
A new instance of Instance.
- #to_solr ⇒ Object
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
#indexers ⇒ Object (readonly)
Returns the value of attribute indexers.
18 19 20 |
# File 'lib/valkyrie/persistence/solr/composite_indexer.rb', line 18 def indexers @indexers end |
#resource ⇒ Object (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_solr ⇒ Object
24 25 26 |
# File 'lib/valkyrie/persistence/solr/composite_indexer.rb', line 24 def to_solr indexers.map(&:to_solr).inject({}, &:merge) end |