Sha256: c515ea3ea23d1fa172b1161f05073869252a5cda14e691f23d0977df02558bd9
Contents?: true
Size: 597 Bytes
Versions: 12
Compression:
Stored size: 597 Bytes
Contents
module Pageflow module FilesHelper def file_format(file) file.format.presence || '-' end def file_dimensions(file) if file.width && file.height "#{file.width} x #{file.height}px" else "-" end end def file_duration(file) if file.duration_in_ms total_seconds = file.duration_in_ms / 1000 seconds = total_seconds % 60 minutes = (total_seconds / 60) % 60 hours = total_seconds / (60 * 60) format("%02d:%02d:%02d", hours, minutes, seconds) else "-" end end end end
Version data entries
12 entries across 12 versions & 1 rubygems