Class: ActiveFedora::RDF::IndexingService

Inherits:
Object
  • Object
show all
Includes:
Solrizer::Common
Defined in:
lib/active_fedora/rdf/indexing_service.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(obj) ⇒ IndexingService

Returns a new instance of IndexingService.

Parameters:

  • obj (#resource, #rdf_subject)

    the object to build an solr document for. Its class must respond to ‘properties’

  • prefix_method (Lambda)

    This method gets the original name of the field and the options passed in. It should return the name of the field in the solr document



8
9
10
# File 'lib/active_fedora/rdf/indexing_service.rb', line 8

def initialize(obj)
  @object = obj
end

Instance Attribute Details

#objectObject (readonly)

Returns the value of attribute object.



4
5
6
# File 'lib/active_fedora/rdf/indexing_service.rb', line 4

def object
  @object
end

Instance Method Details

#generate_solr_document(prefix_method = nil) {|Hash| ... } ⇒ Hash

Creates a solr document hash for the rdf assertions of the #object

Yields:

  • (Hash)

    yields the solr document

Returns:

  • (Hash)

    the solr document



15
16
17
18
19
# File 'lib/active_fedora/rdf/indexing_service.rb', line 15

def generate_solr_document(prefix_method = nil)
  solr_doc = add_assertions(prefix_method)
  yield(solr_doc) if block_given?
  solr_doc
end