Class: Hyrax::IiifManifestPresenter::DisplayImagePresenter

Inherits:
Draper::Decorator
  • Object
show all
Includes:
DisplaysImage
Defined in:
app/presenters/hyrax/iiif_manifest_presenter.rb

Overview

a Presenter for producing ‘IIIFManifest::DisplayImage` objects

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#ability=(value) ⇒ Ability (writeonly)

Returns:



194
195
196
# File 'app/presenters/hyrax/iiif_manifest_presenter.rb', line 194

def ability=(value)
  @ability = value
end

#hostnameObject



212
213
214
# File 'app/presenters/hyrax/iiif_manifest_presenter.rb', line 212

def hostname
  @hostname || 'localhost'
end

Instance Method Details

#display_imageIIIFManifest::DisplayImage

Creates a display image only where #model is an image.

Returns:

  • (IIIFManifest::DisplayImage)

    the display image required by the manifest builder.



200
201
202
203
204
205
206
207
208
209
210
# File 'app/presenters/hyrax/iiif_manifest_presenter.rb', line 200

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.

Returns:

  • (Boolean)

    false



218
219
220
# File 'app/presenters/hyrax/iiif_manifest_presenter.rb', line 218

def work?
  false
end