Class: IIIFManifest::V3::ManifestBuilder::BodyBuilder

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(content, iiif_body_factory:, image_service_builder_factory:) ⇒ BodyBuilder

Returns a new instance of BodyBuilder.


6
7
8
9
10
# File 'lib/iiif_manifest/v3/manifest_builder/body_builder.rb', line 6

def initialize(content, iiif_body_factory:, image_service_builder_factory:)
  @content = content
  @iiif_body_factory = iiif_body_factory
  @image_service_builder_factory = image_service_builder_factory
end

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.


5
6
7
# File 'lib/iiif_manifest/v3/manifest_builder/body_builder.rb', line 5

def content
  @content
end

#iiif_body_factoryObject (readonly)

Returns the value of attribute iiif_body_factory.


5
6
7
# File 'lib/iiif_manifest/v3/manifest_builder/body_builder.rb', line 5

def iiif_body_factory
  @iiif_body_factory
end

#image_service_builder_factoryObject (readonly)

Returns the value of attribute image_service_builder_factory.


5
6
7
# File 'lib/iiif_manifest/v3/manifest_builder/body_builder.rb', line 5

def image_service_builder_factory
  @image_service_builder_factory
end

Instance Method Details

#apply(annotation) ⇒ Object


12
13
14
15
16
17
# File 'lib/iiif_manifest/v3/manifest_builder/body_builder.rb', line 12

def apply(annotation)
  build_body
  image_service_builder.apply(body) if iiif_endpoint
  apply_auth_service if auth_service
  annotation.body = body
end