Class: ActiveFedora::Indexers::GlobalIndexer

Inherits:
Object
  • Object
show all
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

Constructor Details

#initialize(index_types = nil) ⇒ GlobalIndexer

Returns a new instance of GlobalIndexer.

Parameters:

  • index_types (Array<Symbol>) (defaults to: nil)

    The indexing hints to use.



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

Parameters:



19
20
21
# File 'lib/active_fedora/indexers/global_indexer.rb', line 19

def index(index_obj)
  index_obj.as(*index_types) unless index_types.empty?
end

#new(_property) ⇒ Object

The global indexer acts as both an indexer factory and an indexer, since the property doesn’t matter.



13
14
15
# File 'lib/active_fedora/indexers/global_indexer.rb', line 13

def new(_property)
  self
end