Class: Hyrax::ThumbnailPathService
- Inherits:
-
Object
- Object
- Hyrax::ThumbnailPathService
- Defined in:
- app/services/hyrax/thumbnail_path_service.rb
Direct Known Subclasses
Class Method Summary collapse
-
.call(object) ⇒ String
A path to the thumbnail.
Class Method Details
.call(object) ⇒ String
Returns a path to the thumbnail.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'app/services/hyrax/thumbnail_path_service.rb', line 6 def call(object) return default_image unless object.thumbnail_id thumb = fetch_thumbnail(object) return unless thumb return call(thumb) unless thumb.is_a?(::FileSet) if thumb.audio? audio_image elsif thumbnail?(thumb) thumbnail_path(thumb) else default_image end end |