Class: Spotlight::Resources::IiifManifest::Metadata

Inherits:
Object
  • Object
show all
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

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

#labelObject



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_solrObject



187
188
189
# File 'app/models/spotlight/resources/iiif_manifest.rb', line 187

def to_solr
  .merge()
end