Class: ActiveFedora::RDF::FieldMap::PolymorphicBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/active_fedora/rdf/field_map.rb

Overview

Supports assigning the delegate class that calls .build to insert the fields into the solr document.

Direct Known Subclasses

Builder

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(entry, index_field_config, object, name) ⇒ PolymorphicBuilder

Returns a new instance of PolymorphicBuilder.



33
34
35
36
37
38
39
# File 'lib/active_fedora/rdf/field_map.rb', line 33

def initialize(entry, index_field_config, object, name)
  @entry              = entry
  @index_field_config = index_field_config
  @object             = object
  @name               = name
  self
end

Instance Attribute Details

#entryObject

instance of ActiveFedora::RDF::FieldMapEntry which will contain the values of the solr field

Returns:

  • (Object)

    the current value of entry



30
31
32
# File 'lib/active_fedora/rdf/field_map.rb', line 30

def entry
  @entry
end

#index_field_configObject

an instance of ActiveFedora::Indexing::Map::IndexObject

Returns:

  • (Object)

    the current value of index_field_config



30
31
32
# File 'lib/active_fedora/rdf/field_map.rb', line 30

def index_field_config
  @index_field_config
end

#nameSymbol

the name of the property on the object that we’re indexing

Returns:

  • (Symbol)

    the current value of name



30
31
32
# File 'lib/active_fedora/rdf/field_map.rb', line 30

def name
  @name
end

#objectObject

the instance of ActiveFedora::Base which is being indexed into Solr

Returns:

  • (Object)

    the current value of object



30
31
32
# File 'lib/active_fedora/rdf/field_map.rb', line 30

def object
  @object
end

Instance Method Details

#buildObject



41
42
43
# File 'lib/active_fedora/rdf/field_map.rb', line 41

def build
  delegate_class.new(entry, index_field_config, object, name).build
end