Class: ActiveFedora::RDF::FieldMap
- Inherits:
-
Object
- Object
- ActiveFedora::RDF::FieldMap
- Extended by:
- Forwardable
- Defined in:
- lib/active_fedora/rdf/field_map.rb
Overview
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.
Defined Under Namespace
Classes: Builder, PolymorphicBuilder, PropertyBuilder, ResourceBuilder
Instance Method Summary collapse
-
#initialize(hash = {}) {|_self| ... } ⇒ FieldMap
constructor
A new instance of FieldMap.
-
#insert(name, index_field_config, object) ⇒ Object
Inserts each solr field map configuration into the FieldMap class.
Constructor Details
#initialize(hash = {}) {|_self| ... } ⇒ FieldMap
Returns a new instance of FieldMap.
11 12 13 14 |
# File 'lib/active_fedora/rdf/field_map.rb', line 11 def initialize(hash = {}, &_block) @hash = hash yield self if block_given? end |
Instance Method Details
#insert(name, index_field_config, object) ⇒ Object
Inserts each solr field map configuration into the FieldMap class
20 21 22 23 |
# 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 |