Class: IIIFManifest::ManifestBuilder::ImageServiceBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/iiif_manifest/manifest_builder/image_service_builder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(iiif_endpoint, iiif_service_factory:) ⇒ ImageServiceBuilder

Returns a new instance of ImageServiceBuilder.



5
6
7
8
# File 'lib/iiif_manifest/manifest_builder/image_service_builder.rb', line 5

def initialize(iiif_endpoint, iiif_service_factory:)
  @iiif_endpoint = iiif_endpoint
  @iiif_service_factory = iiif_service_factory
end

Instance Attribute Details

#iiif_endpointObject (readonly)

Returns the value of attribute iiif_endpoint.



4
5
6
# File 'lib/iiif_manifest/manifest_builder/image_service_builder.rb', line 4

def iiif_endpoint
  @iiif_endpoint
end

#iiif_service_factoryObject (readonly)

Returns the value of attribute iiif_service_factory.



4
5
6
# File 'lib/iiif_manifest/manifest_builder/image_service_builder.rb', line 4

def iiif_service_factory
  @iiif_service_factory
end

Instance Method Details

#apply(resource) ⇒ Object



10
11
12
13
14
15
# File 'lib/iiif_manifest/manifest_builder/image_service_builder.rb', line 10

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