Class: IIIFManifest::V3::ManifestFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/iiif_manifest/v3/manifest_factory.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(manifest_service_locator) ⇒ ManifestFactory

Returns a new instance of ManifestFactory.



14
15
16
# File 'lib/iiif_manifest/v3/manifest_factory.rb', line 14

def initialize(manifest_service_locator)
  @manifest_service_locator = manifest_service_locator
end

Instance Attribute Details

#manifest_service_locatorObject (readonly)

Returns the value of attribute manifest_service_locator.



12
13
14
# File 'lib/iiif_manifest/v3/manifest_factory.rb', line 12

def manifest_service_locator
  @manifest_service_locator
end

Class Method Details

.new(work, manifest_service_locator: ManifestServiceLocator) ⇒ Object



5
6
7
# File 'lib/iiif_manifest/v3/manifest_factory.rb', line 5

def new(work, manifest_service_locator: ManifestServiceLocator)
  super(manifest_service_locator).new(work)
end

Instance Method Details

#new(work) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/iiif_manifest/v3/manifest_factory.rb', line 18

def new(work)
  if !work.work_presenters.empty?
    if sammelband?(work) || !work.file_set_presenters.empty?
      manifest_builder.new(work)
    elsif work.file_set_presenters.empty?
      work = IIIFManifest::IIIFCollection.new(work)
      collection_manifest_builder.new(work)
    end
  else
    manifest_builder.new(work)
  end
end