Class: Hyrax::IiifManifestPresenter::DisplayImagePresenter
- Inherits:
-
Draper::Decorator
- Object
- Draper::Decorator
- Hyrax::IiifManifestPresenter::DisplayImagePresenter
- Includes:
- DisplaysImage
- Defined in:
- app/presenters/hyrax/iiif_manifest_presenter.rb
Overview
a Presenter for producing ‘IIIFManifest::DisplayImage` objects
Instance Attribute Summary collapse
- #ability ⇒ Ability writeonly
- #hostname ⇒ Object
Instance Method Summary collapse
-
#display_image ⇒ IIIFManifest::DisplayImage
Creates a display image only where #model is an image.
-
#work? ⇒ Boolean
False.
Instance Attribute Details
#ability=(value) ⇒ Ability (writeonly)
189 190 191 |
# File 'app/presenters/hyrax/iiif_manifest_presenter.rb', line 189 def ability=(value) @ability = value end |
#hostname ⇒ Object
207 208 209 |
# File 'app/presenters/hyrax/iiif_manifest_presenter.rb', line 207 def hostname @hostname || 'localhost' end |
Instance Method Details
#display_image ⇒ IIIFManifest::DisplayImage
Creates a display image only where #model is an image.
195 196 197 198 199 200 201 202 203 204 205 |
# File 'app/presenters/hyrax/iiif_manifest_presenter.rb', line 195 def display_image return nil unless model.image? return nil unless latest_file_id IIIFManifest::DisplayImage .new(display_image_url(hostname), format: image_format(alpha_channels), width: width, height: height, iiif_endpoint: iiif_endpoint(latest_file_id, base_url: hostname)) end |
#work? ⇒ Boolean
Returns false.
213 214 215 |
# File 'app/presenters/hyrax/iiif_manifest_presenter.rb', line 213 def work? false end |