Class: Hyrax::ManifestBuilderService
- Inherits:
-
Object
- Object
- Hyrax::ManifestBuilderService
- Defined in:
- app/services/hyrax/manifest_builder_service.rb
Overview
A class responsible for converting a Hyrax::Work like thing into a IIIF manifest.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#manifest_factory ⇒ Object
readonly
Returns the value of attribute manifest_factory.
Class Method Summary collapse
-
.manifest_for(presenter:, iiif_manifest_factory: ::IIIFManifest::ManifestFactory) ⇒ Hash
A Ruby hash representation of a IIIF manifest document.
Instance Method Summary collapse
-
#initialize(iiif_manifest_factory: ::IIIFManifest::ManifestFactory) ⇒ ManifestBuilderService
constructor
A new instance of ManifestBuilderService.
-
#manifest_for(presenter:) ⇒ Hash
A Ruby hash representation of a IIIF manifest document.
Constructor Details
#initialize(iiif_manifest_factory: ::IIIFManifest::ManifestFactory) ⇒ ManifestBuilderService
Returns a new instance of ManifestBuilderService.
39 40 41 |
# File 'app/services/hyrax/manifest_builder_service.rb', line 39 def initialize(iiif_manifest_factory: ::IIIFManifest::ManifestFactory) @manifest_factory = iiif_manifest_factory end |
Instance Attribute Details
#manifest_factory ⇒ Object (readonly)
Returns the value of attribute manifest_factory.
32 33 34 |
# File 'app/services/hyrax/manifest_builder_service.rb', line 32 def manifest_factory @manifest_factory end |
Class Method Details
.manifest_for(presenter:, iiif_manifest_factory: ::IIIFManifest::ManifestFactory) ⇒ Hash
Note:
While the :presenter may be a Hyrax::WorkShowPresenter it is likely defined by Hyrax::WorksControllerBehavior.show_presenter
Returns a Ruby hash representation of a IIIF manifest document.
24 25 26 27 |
# File 'app/services/hyrax/manifest_builder_service.rb', line 24 def self.manifest_for(presenter:, iiif_manifest_factory: ::IIIFManifest::ManifestFactory) new(iiif_manifest_factory: iiif_manifest_factory) .manifest_for(presenter: presenter) end |
Instance Method Details
#manifest_for(presenter:) ⇒ Hash
Returns a Ruby hash representation of a IIIF manifest document.
49 50 51 |
# File 'app/services/hyrax/manifest_builder_service.rb', line 49 def manifest_for(presenter:) sanitized_manifest(presenter: presenter) end |