Class: ActiveFedora::Indexers::GlobalIndexer
- Inherits:
-
Object
- Object
- ActiveFedora::Indexers::GlobalIndexer
- Defined in:
- lib/active_fedora/indexers/global_indexer.rb
Overview
Applies indexing hints to any given property, independent of what that property
Instance Method Summary collapse
- #index(index_obj) ⇒ Object
-
#initialize(index_types = nil) ⇒ GlobalIndexer
constructor
A new instance of GlobalIndexer.
-
#new(property) ⇒ Object
The global indexer acts as both an indexer factory and an indexer, since the property doesn’t matter.
Constructor Details
#initialize(index_types = nil) ⇒ GlobalIndexer
Returns a new instance of GlobalIndexer.
7 8 9 |
# File 'lib/active_fedora/indexers/global_indexer.rb', line 7 def initialize(index_types=nil) @index_types = Array.wrap(index_types) end |
Instance Method Details
#index(index_obj) ⇒ Object
20 21 22 23 24 |
# File 'lib/active_fedora/indexers/global_indexer.rb', line 20 def index(index_obj) unless index_types.empty? index_obj.as(*index_types) end end |
#new(property) ⇒ Object
The global indexer acts as both an indexer factory and an indexer, since the property doesn’t matter.
14 15 16 |
# File 'lib/active_fedora/indexers/global_indexer.rb', line 14 def new(property) self end |