Class: IIIFManifest::ManifestBuilder::ChildManifestBuilderFactory

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(child_manifest_builder:, composite_builder:) ⇒ ChildManifestBuilderFactory

Returns a new instance of ChildManifestBuilderFactory.



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

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

Instance Attribute Details

#child_manifest_builderObject (readonly)

Returns the value of attribute child_manifest_builder.



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

def child_manifest_builder
  @child_manifest_builder
end

#composite_builderObject (readonly)

Returns the value of attribute composite_builder.



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

def composite_builder
  @composite_builder
end

Instance Method Details

#new(work) ⇒ Object



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

def new(work)
  composite_builder.new(
    *work.work_presenters.map do |work_presenter|
      child_manifest_builder.new(work_presenter)
    end
  )
end