Class: IIIFManifest::ManifestFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/iiif_manifest/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.



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

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.



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

def manifest_service_locator
  @manifest_service_locator
end

Class Method Details

.new(work, manifest_service_locator: ManifestServiceLocator) ⇒ Object



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

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

Instance Method Details

#new(work) ⇒ Object



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

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