Class: Spotlight::Resources::IiifManifest
- Inherits:
-
Object
- Object
- Spotlight::Resources::IiifManifest
- Defined in:
- app/models/spotlight/resources/iiif_manifest.rb
Overview
A PORO to construct a solr hash for a given IiifManifest
Defined Under Namespace
Classes: Metadata
Instance Attribute Summary collapse
-
#collection ⇒ Object
readonly
Returns the value of attribute collection.
Instance Method Summary collapse
- #compound_id ⇒ Object
-
#initialize(attrs = {}) ⇒ IiifManifest
constructor
A new instance of IiifManifest.
- #to_solr ⇒ Object
- #with_exhibit(e) ⇒ Object
Constructor Details
#initialize(attrs = {}) ⇒ IiifManifest
Returns a new instance of IiifManifest.
7 8 9 10 11 12 |
# File 'app/models/spotlight/resources/iiif_manifest.rb', line 7 def initialize(attrs = {}) @url = attrs[:url] @manifest = attrs[:manifest] @collection = attrs[:collection] @solr_hash = {} end |
Instance Attribute Details
#collection ⇒ Object (readonly)
Returns the value of attribute collection.
6 7 8 |
# File 'app/models/spotlight/resources/iiif_manifest.rb', line 6 def collection @collection end |
Instance Method Details
#compound_id ⇒ Object
30 31 32 |
# File 'app/models/spotlight/resources/iiif_manifest.rb', line 30 def compound_id Digest::MD5.hexdigest("#{exhibit.id}-#{url}") end |
#to_solr ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'app/models/spotlight/resources/iiif_manifest.rb', line 14 def to_solr add_document_id add_label add_thumbnail_url add_full_image_urls add_manifest_url add_image_urls add_collection_id solr_hash end |
#with_exhibit(e) ⇒ Object
26 27 28 |
# File 'app/models/spotlight/resources/iiif_manifest.rb', line 26 def with_exhibit(e) @exhibit = e end |