Module: Hyrax::DisplaysContent

Extended by:
ActiveSupport::Concern
Included in:
IiifManifestPresenter::DisplayImagePresenter
Defined in:
app/presenters/hyrax/displays_content.rb

Overview

rubocop:disable Metrics/ModuleLength

Instance Method Summary collapse

Instance Method Details

#display_contentIIIFManifest::V3::DisplayContent

Creates a display content only where FileSet is an image, audio, or video.

Returns:

  • (IIIFManifest::V3::DisplayContent)

    the display content required by the manifest builder.



10
11
12
13
14
15
16
17
# File 'app/presenters/hyrax/displays_content.rb', line 10

def display_content
  return nil unless ability.can?(:read, object)

  return image_content if image?
  return video_content if video? && Flipflop.iiif_av?
  return audio_content if audio? && Flipflop.iiif_av?
  return pdf_content if pdf? && Flipflop.iiif_pdf?
end