Class: IIIFManifest::ManifestBuilder::CanvasBuilderFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/iiif_manifest/manifest_builder/canvas_builder_factory.rb

Direct Known Subclasses

DeepCanvasBuilderFactory

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(composite_builder:, canvas_builder_factory:) ⇒ CanvasBuilderFactory

Returns a new instance of CanvasBuilderFactory.



5
6
7
8
# File 'lib/iiif_manifest/manifest_builder/canvas_builder_factory.rb', line 5

def initialize(composite_builder:, canvas_builder_factory:)
  @composite_builder = composite_builder
  @canvas_builder_factory = canvas_builder_factory
end

Instance Attribute Details

#canvas_builder_factoryObject (readonly)

Returns the value of attribute canvas_builder_factory.



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

def canvas_builder_factory
  @canvas_builder_factory
end

#composite_builderObject (readonly)

Returns the value of attribute composite_builder.



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

def composite_builder
  @composite_builder
end

Instance Method Details

#from(work) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/iiif_manifest/manifest_builder/canvas_builder_factory.rb', line 10

def from(work)
  composite_builder.new(
    *file_set_presenters(work).map do |presenter|
      canvas_builder_factory.new(presenter, work)
    end
  )
end