Class: ActiveFedora::RDF::FieldMapEntry
- Inherits:
-
Object
- Object
- ActiveFedora::RDF::FieldMapEntry
- Defined in:
- lib/active_fedora/rdf/field_map_entry.rb
Overview
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.
Instance Attribute Summary collapse
-
#behaviors ⇒ Object
Returns the value of attribute behaviors.
-
#behaviors the indexing hints such as :stored_searchable or :symbol(theindexinghintssuchas: stored_searchable) ⇒ Object
readonly
Transient class that represents a field that we send to solr.
-
#type ⇒ Object
Returns the value of attribute type.
-
#values ⇒ Object
Returns the value of attribute values.
-
#values the actual values that get sent to solr(theactualvaluesthatgetsenttosolr) ⇒ Object
readonly
Transient class that represents a field that we send to solr.
Instance Method Summary collapse
-
#initialize ⇒ FieldMapEntry
constructor
A new instance of FieldMapEntry.
-
#merge!(type, behaviors, values) ⇒ Object
Merges any existing values for solr fields with new, incoming values and ensures that resulting values are unique.
-
#type the data type hint for Solrizer=(thedatatypehint) ⇒ Object
Transient class that represents a field that we send to solr.
Constructor Details
#initialize ⇒ FieldMapEntry
Returns a new instance of FieldMapEntry.
10 11 12 13 |
# File 'lib/active_fedora/rdf/field_map_entry.rb', line 10 def initialize @behaviors = [] @values = [] end |
Instance Attribute Details
#behaviors ⇒ Object
Returns the value of attribute behaviors.
8 9 10 |
# File 'lib/active_fedora/rdf/field_map_entry.rb', line 8 def behaviors @behaviors end |
#behaviors the indexing hints such as :stored_searchable or :symbol(theindexinghintssuchas: stored_searchable) ⇒ Object (readonly)
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.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/active_fedora/rdf/field_map_entry.rb', line 7 class FieldMapEntry attr_accessor :type, :behaviors, :values def initialize @behaviors = [] @values = [] end # 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 Solrizer's behaviors for indexing such as :stored_searhable, :symbol # @param [Array] values existing values for the solr field def merge!(type, behaviors, values) self.type ||= type self.behaviors += behaviors self.behaviors.uniq! self.values += values end end |
#type ⇒ Object
Returns the value of attribute type.
8 9 10 |
# File 'lib/active_fedora/rdf/field_map_entry.rb', line 8 def type @type end |
#values ⇒ Object
Returns the value of attribute values.
8 9 10 |
# File 'lib/active_fedora/rdf/field_map_entry.rb', line 8 def values @values end |
#values the actual values that get sent to solr(theactualvaluesthatgetsenttosolr) ⇒ Object (readonly)
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.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/active_fedora/rdf/field_map_entry.rb', line 7 class FieldMapEntry attr_accessor :type, :behaviors, :values def initialize @behaviors = [] @values = [] end # 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 Solrizer's behaviors for indexing such as :stored_searhable, :symbol # @param [Array] values existing values for the solr field def merge!(type, behaviors, values) self.type ||= type self.behaviors += behaviors self.behaviors.uniq! self.values += values end end |
Instance Method Details
#merge!(type, behaviors, values) ⇒ Object
Merges any existing values for solr fields with new, incoming values and ensures that resulting values are unique.
19 20 21 22 23 24 |
# File 'lib/active_fedora/rdf/field_map_entry.rb', line 19 def merge!(type, behaviors, values) self.type ||= type self.behaviors += behaviors self.behaviors.uniq! self.values += values end |
#type the data type hint for Solrizer=(thedatatypehint) ⇒ Object
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.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/active_fedora/rdf/field_map_entry.rb', line 7 class FieldMapEntry attr_accessor :type, :behaviors, :values def initialize @behaviors = [] @values = [] end # 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 Solrizer's behaviors for indexing such as :stored_searhable, :symbol # @param [Array] values existing values for the solr field def merge!(type, behaviors, values) self.type ||= type self.behaviors += behaviors self.behaviors.uniq! self.values += values end end |