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.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'app/services/hyrax/thumbnail_path_service.rb', line 7 def call(object) return default_image if object.try(:thumbnail_id).blank? thumb = fetch_thumbnail(object) return default_image unless thumb return call(thumb) unless thumb.file_set? if audio?(thumb) audio_image elsif thumbnail?(thumb) thumbnail_path(thumb) else default_image end end |