Class: IIIFManifest::ManifestBuilder::SequenceBuilder
- Inherits:
-
Object
- Object
- IIIFManifest::ManifestBuilder::SequenceBuilder
- Defined in:
- lib/iiif_manifest/manifest_builder/sequence_builder.rb
Instance Attribute Summary collapse
-
#canvas_builder_factory ⇒ Object
readonly
Returns the value of attribute canvas_builder_factory.
-
#sequence_factory ⇒ Object
readonly
Returns the value of attribute sequence_factory.
-
#work ⇒ Object
readonly
Returns the value of attribute work.
Instance Method Summary collapse
- #apply(manifest) ⇒ Object
- #empty? ⇒ Boolean
-
#initialize(work, canvas_builder_factory:, sequence_factory:) ⇒ SequenceBuilder
constructor
A new instance of SequenceBuilder.
Constructor Details
#initialize(work, canvas_builder_factory:, sequence_factory:) ⇒ SequenceBuilder
Returns a new instance of SequenceBuilder.
5 6 7 8 9 |
# File 'lib/iiif_manifest/manifest_builder/sequence_builder.rb', line 5 def initialize(work, canvas_builder_factory:, sequence_factory:) @work = work @canvas_builder_factory = canvas_builder_factory @sequence_factory = sequence_factory end |
Instance Attribute Details
#canvas_builder_factory ⇒ Object (readonly)
Returns the value of attribute canvas_builder_factory.
4 5 6 |
# File 'lib/iiif_manifest/manifest_builder/sequence_builder.rb', line 4 def canvas_builder_factory @canvas_builder_factory end |
#sequence_factory ⇒ Object (readonly)
Returns the value of attribute sequence_factory.
4 5 6 |
# File 'lib/iiif_manifest/manifest_builder/sequence_builder.rb', line 4 def sequence_factory @sequence_factory end |
#work ⇒ Object (readonly)
Returns the value of attribute work.
4 5 6 |
# File 'lib/iiif_manifest/manifest_builder/sequence_builder.rb', line 4 def work @work end |
Instance Method Details
#apply(manifest) ⇒ Object
11 12 13 14 15 |
# File 'lib/iiif_manifest/manifest_builder/sequence_builder.rb', line 11 def apply(manifest) # sequence.viewing_hint = manifest.viewing_hint manifest.sequences += [sequence] unless empty? manifest end |
#empty? ⇒ Boolean
17 18 19 |
# File 'lib/iiif_manifest/manifest_builder/sequence_builder.rb', line 17 def empty? sequence.canvases.empty? end |