Sha256: e2e7275bdfbab89a0eee276ebf1c223f8dae6d7424822a19f64c93807965d888

Contents?: true

Size: 517 Bytes

Versions: 4

Compression:

Stored size: 517 Bytes

Contents

module IIIFManifest
  class ManifestBuilder
    class ImageServiceBuilder
      attr_reader :iiif_endpoint
      def initialize(iiif_endpoint)
        @iiif_endpoint = iiif_endpoint
      end

      def apply(resource)
        service['@context'] = iiif_endpoint.context
        service['@id'] = iiif_endpoint.url
        service['profile'] = iiif_endpoint.profile
        resource.service = service
      end

      private

        def service
          @service ||= IIIF::Service.new
        end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
iiif_manifest-0.2.0 lib/iiif_manifest/manifest_builder/image_service_builder.rb
iiif_manifest-0.1.2 lib/iiif_manifest/manifest_builder/image_service_builder.rb
iiif_manifest-0.1.1 lib/iiif_manifest/manifest_builder/image_service_builder.rb
iiif_manifest-0.1.0 lib/iiif_manifest/manifest_builder/image_service_builder.rb