class ActiveFedora::RDF::FieldMap
Transient class that maps solr field names, without their suffixes, to the values and behaviors that are used to transforming them for insertion into the solr document. It partially extends Ruby’s Hash class, similar to the way ActiveFedora::Indexing::Map
does, but only with selected methods as outlined in def_delegators.
Public Class Methods
new(hash = {}) { |self| ... }
click to toggle source
# File lib/active_fedora/rdf/field_map.rb, line 11 def initialize(hash = {}, &_block) @hash = hash yield self if block_given? end
Public Instance Methods
insert(name, index_field_config, object)
click to toggle source
Inserts each solr field map configuration into the FieldMap
class @param [Symbol] name the name of the property on the object that we’re indexing @param [ActiveFedora::Indexing::Map::IndexObject] index_field_config describes how the object should be indexed @param [ActiveFedora::Base] object the object to be indexed into Solr
# File lib/active_fedora/rdf/field_map.rb, line 20 def insert(name, index_field_config, object) self[index_field_config.key.to_s] ||= FieldMapEntry.new PolymorphicBuilder.new(self[index_field_config.key.to_s], index_field_config, object, name).build end