Class: IIIFManifest::ManifestBuilder::RecordPropertyBuilder
- Inherits:
-
Object
- Object
- IIIFManifest::ManifestBuilder::RecordPropertyBuilder
- Defined in:
- lib/iiif_manifest/manifest_builder/record_property_builder.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#iiif_autocomplete_service_factory ⇒ Object
readonly
Returns the value of attribute iiif_autocomplete_service_factory.
-
#iiif_search_service_factory ⇒ Object
readonly
Returns the value of attribute iiif_search_service_factory.
-
#record ⇒ Object
readonly
Returns the value of attribute record.
Instance Method Summary collapse
- #apply(manifest) ⇒ Object
-
#initialize(record, iiif_search_service_factory:, iiif_autocomplete_service_factory:) ⇒ RecordPropertyBuilder
constructor
A new instance of RecordPropertyBuilder.
Constructor Details
#initialize(record, iiif_search_service_factory:, iiif_autocomplete_service_factory:) ⇒ RecordPropertyBuilder
Returns a new instance of RecordPropertyBuilder.
5 6 7 8 9 |
# File 'lib/iiif_manifest/manifest_builder/record_property_builder.rb', line 5 def initialize(record, iiif_search_service_factory:, iiif_autocomplete_service_factory:) @record = record @iiif_search_service_factory = iiif_search_service_factory @iiif_autocomplete_service_factory = iiif_autocomplete_service_factory end |
Instance Attribute Details
#iiif_autocomplete_service_factory ⇒ Object (readonly)
Returns the value of attribute iiif_autocomplete_service_factory.
4 5 6 |
# File 'lib/iiif_manifest/manifest_builder/record_property_builder.rb', line 4 def iiif_autocomplete_service_factory @iiif_autocomplete_service_factory end |
#iiif_search_service_factory ⇒ Object (readonly)
Returns the value of attribute iiif_search_service_factory.
4 5 6 |
# File 'lib/iiif_manifest/manifest_builder/record_property_builder.rb', line 4 def iiif_search_service_factory @iiif_search_service_factory end |
#record ⇒ Object (readonly)
Returns the value of attribute record.
4 5 6 |
# File 'lib/iiif_manifest/manifest_builder/record_property_builder.rb', line 4 def record @record end |
Instance Method Details
#apply(manifest) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/iiif_manifest/manifest_builder/record_property_builder.rb', line 11 def apply(manifest) manifest['@id'] = record.manifest_url.to_s label = Array(::IIIFManifest.config.manifest_value_for(record, property: :label)).first manifest.label = label description = Array(::IIIFManifest.config.manifest_value_for(record, property: :description)).first manifest.description = description manifest.viewing_hint = viewing_hint if viewing_hint.present? manifest.viewing_direction = viewing_direction if viewing_direction.present? manifest. = record. if manifest.service = services if search_service.present? manifest end |