Class: Spotlight::Resources::IiifManifest::Metadata
- Inherits:
-
Object
- Object
- Spotlight::Resources::IiifManifest::Metadata
- Defined in:
- app/models/spotlight/resources/iiif_manifest.rb
Overview
A simple class to map the metadata field
in a IIIF document to label/value pairs
This is intended to be overriden by an
application if a different metadata
strucure is used by the consumer
Instance Method Summary collapse
-
#initialize(manifest) ⇒ Metadata
constructor
A new instance of Metadata.
- #label ⇒ Object
- #to_solr ⇒ Object
Constructor Details
#initialize(manifest) ⇒ Metadata
Returns a new instance of Metadata.
183 184 185 |
# File 'app/models/spotlight/resources/iiif_manifest.rb', line 183 def initialize(manifest) @manifest = manifest end |
Instance Method Details
#label ⇒ Object
191 192 193 194 195 |
# File 'app/models/spotlight/resources/iiif_manifest.rb', line 191 def label return unless manifest&.label Array(json_ld_value(manifest.label)).map { |v| html_sanitize(v) }.first end |
#to_solr ⇒ Object
187 188 189 |
# File 'app/models/spotlight/resources/iiif_manifest.rb', line 187 def to_solr .merge() end |