Sha256: 1b360ec9b2d173ef8dc40157a41fae8e40fdf4644673a4d22ea46236cf62c5cb
Contents?: true
Size: 944 Bytes
Versions: 7
Compression:
Stored size: 944 Bytes
Contents
module IIIFManifest module V3 class ManifestBuilder class ImageServiceBuilder attr_reader :iiif_endpoint, :iiif_service_factory def initialize(iiif_endpoint, iiif_service_factory:) @iiif_endpoint = iiif_endpoint @iiif_service_factory = iiif_service_factory end def apply(resource) service['@id'] = iiif_endpoint.url service['profile'] = iiif_endpoint.profile service['@type'] = determine_type(iiif_endpoint.context) resource.service = [service] end private def determine_type(context) case context when 'http://iiif.io/api/image/1/context.json' 'ImageService1' when 'http://iiif.io/api/image/2/context.json' 'ImageService2' end end def service @service ||= iiif_service_factory.new end end end end end
Version data entries
7 entries across 7 versions & 2 rubygems