Class: IIIFManifest::ManifestBuilder
- Inherits:
-
Object
- Object
- IIIFManifest::ManifestBuilder
- Defined in:
- lib/iiif_manifest/manifest_builder.rb,
lib/iiif_manifest/manifest_builder/iiif_service.rb,
lib/iiif_manifest/manifest_builder/image_builder.rb,
lib/iiif_manifest/manifest_builder/canvas_builder.rb,
lib/iiif_manifest/manifest_builder/resource_builder.rb,
lib/iiif_manifest/manifest_builder/sequence_builder.rb,
lib/iiif_manifest/manifest_builder/composite_builder.rb,
lib/iiif_manifest/manifest_builder/structure_builder.rb,
lib/iiif_manifest/manifest_builder/image_service_builder.rb,
lib/iiif_manifest/manifest_builder/canvas_builder_factory.rb,
lib/iiif_manifest/manifest_builder/record_property_builder.rb,
lib/iiif_manifest/manifest_builder/composite_builder_factory.rb,
lib/iiif_manifest/manifest_builder/deep_canvas_builder_factory.rb,
lib/iiif_manifest/manifest_builder/child_manifest_builder_factory.rb
Defined Under Namespace
Classes: CanvasBuilder, CanvasBuilderFactory, ChildManifestBuilderFactory, CompositeBuilder, CompositeBuilderFactory, DeepCanvasBuilderFactory, DeepFileSetEnumerator, IIIFManifest, IIIFService, ImageBuilder, ImageServiceBuilder, RangeBuilder, RecordPropertyBuilder, ResourceBuilder, SequenceBuilder, StructureBuilder
Instance Attribute Summary collapse
-
#builders ⇒ Object
readonly
Returns the value of attribute builders.
-
#top_record_factory ⇒ Object
readonly
Returns the value of attribute top_record_factory.
-
#work ⇒ Object
readonly
Returns the value of attribute work.
Instance Method Summary collapse
- #apply(collection) ⇒ Object
-
#initialize(work, builders:, top_record_factory:) ⇒ ManifestBuilder
constructor
A new instance of ManifestBuilder.
- #to_h ⇒ Object
Constructor Details
#initialize(work, builders:, top_record_factory:) ⇒ ManifestBuilder
Returns a new instance of ManifestBuilder.
20 21 22 23 24 |
# File 'lib/iiif_manifest/manifest_builder.rb', line 20 def initialize(work, builders:, top_record_factory:) @work = work @builders = builders @top_record_factory = top_record_factory end |
Instance Attribute Details
#builders ⇒ Object (readonly)
Returns the value of attribute builders.
17 18 19 |
# File 'lib/iiif_manifest/manifest_builder.rb', line 17 def builders @builders end |
#top_record_factory ⇒ Object (readonly)
Returns the value of attribute top_record_factory.
17 18 19 |
# File 'lib/iiif_manifest/manifest_builder.rb', line 17 def top_record_factory @top_record_factory end |
#work ⇒ Object (readonly)
Returns the value of attribute work.
17 18 19 |
# File 'lib/iiif_manifest/manifest_builder.rb', line 17 def work @work end |
Instance Method Details
#apply(collection) ⇒ Object
26 27 28 29 30 |
# File 'lib/iiif_manifest/manifest_builder.rb', line 26 def apply(collection) collection['manifests'] ||= [] collection['manifests'] << to_h collection end |
#to_h ⇒ Object
32 33 34 |
# File 'lib/iiif_manifest/manifest_builder.rb', line 32 def to_h @to_h ||= builders.new(work).apply(top_record) end |