class ActiveFedora::RDF::FieldMapEntry
Transient class that represents a field that we send to solr. It might be possible for two properties to share a single field map entry if they use the same solr key. @attribute [Symbol] type the data type hint for ActiveFedora::Indexing::FieldMapper
@attribute [Array] behaviors the indexing hints such as :stored_searchable or :symbol @!attribute [w] values the raw values
Attributes
Public Class Methods
# File lib/active_fedora/rdf/field_map_entry.rb, line 11 def initialize @behaviors = [] @values = [] end
Public Instance Methods
Merges any existing values for solr fields with new, incoming values and ensures that resulting values are unique. @param [Symbol] type the data type for the field such as :string, :date, :integer @param [Array] behaviors FieldMapper’s behaviors for indexing such as :stored_searchable, :symbol @param [Array] new_values values to append into the existing solr field
# File lib/active_fedora/rdf/field_map_entry.rb, line 20 def merge!(type, behaviors, new_values) self.type ||= type self.behaviors += behaviors self.behaviors.uniq! self.values += new_values end
@return [Array] the actual values that get sent to solr
# File lib/active_fedora/rdf/field_map_entry.rb, line 28 def values @values.map do |value| ValueCaster.new(value).value end end