Class: IIIFManifest::V3::ManifestBuilder::ImageServiceBuilder
- Inherits:
-
Object
- Object
- IIIFManifest::V3::ManifestBuilder::ImageServiceBuilder
- Defined in:
- lib/iiif_manifest/v3/manifest_builder/image_service_builder.rb
Instance Attribute Summary collapse
-
#iiif_endpoint ⇒ Object
readonly
Returns the value of attribute iiif_endpoint.
-
#iiif_service_factory ⇒ Object
readonly
Returns the value of attribute iiif_service_factory.
Instance Method Summary collapse
- #apply(resource) ⇒ Object
-
#initialize(iiif_endpoint, iiif_service_factory:) ⇒ ImageServiceBuilder
constructor
A new instance of ImageServiceBuilder.
Constructor Details
#initialize(iiif_endpoint, iiif_service_factory:) ⇒ ImageServiceBuilder
Returns a new instance of ImageServiceBuilder.
6 7 8 9 |
# File 'lib/iiif_manifest/v3/manifest_builder/image_service_builder.rb', line 6 def initialize(iiif_endpoint, iiif_service_factory:) @iiif_endpoint = iiif_endpoint @iiif_service_factory = iiif_service_factory end |
Instance Attribute Details
#iiif_endpoint ⇒ Object (readonly)
Returns the value of attribute iiif_endpoint.
5 6 7 |
# File 'lib/iiif_manifest/v3/manifest_builder/image_service_builder.rb', line 5 def iiif_endpoint @iiif_endpoint end |
#iiif_service_factory ⇒ Object (readonly)
Returns the value of attribute iiif_service_factory.
5 6 7 |
# File 'lib/iiif_manifest/v3/manifest_builder/image_service_builder.rb', line 5 def iiif_service_factory @iiif_service_factory end |
Instance Method Details
#apply(resource) ⇒ Object
11 12 13 14 15 16 |
# File 'lib/iiif_manifest/v3/manifest_builder/image_service_builder.rb', line 11 def apply(resource) service['@id'] = iiif_endpoint.url service['profile'] = iiif_endpoint.profile service['@type'] = determine_type(iiif_endpoint.context) resource.service = [service] end |