Class: IIIFManifest::ManifestFactory
- Inherits:
-
Object
- Object
- IIIFManifest::ManifestFactory
- Defined in:
- lib/iiif_manifest/manifest_factory.rb
Instance Attribute Summary collapse
-
#manifest_service_locator ⇒ Object
readonly
Returns the value of attribute manifest_service_locator.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(manifest_service_locator) ⇒ ManifestFactory
constructor
A new instance of ManifestFactory.
- #new(work) ⇒ Object
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_locator ⇒ Object (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 |