Sha256: 1efb6775f680457b9a802f55773d9a757f723a5c39938eaf2a7da42b8783d3a9
Contents?: true
Size: 333 Bytes
Versions: 15
Compression:
Stored size: 333 Bytes
Contents
module Hydra::PCDM module GetMimeTypeForFile def self.call(path) raise ArgumentError, 'supplied argument should be a path to a file' unless path.is_a?(String) mime_types = ::MIME::Types.of(::File.basename(path)) mime_types.empty? ? 'application/octet-stream' : mime_types.first.content_type end end end
Version data entries
15 entries across 15 versions & 1 rubygems