class ActiveFedora::Indexers::GlobalIndexer

Applies indexing hints to any given property, independent of what that property

Attributes

index_types[R]

Public Class Methods

new(index_types = nil) click to toggle source

@param [Array<Symbol>] index_types The indexing hints to use.

# File lib/active_fedora/indexers/global_indexer.rb, line 7
def initialize(index_types = nil)
  @index_types = Array.wrap(index_types)
end

Public Instance Methods

index(index_obj) click to toggle source

@param [ActiveFedora::Indexing::Map::IndexObject, as] index_obj The indexing

object to call #as on.
# 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) click to toggle source

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

# File lib/active_fedora/indexers/global_indexer.rb, line 13
def new(_property)
  self
end