Module: Axlsx::MimeTypeUtils
- Defined in:
- lib/axlsx/util/mime_type_utils.rb
Overview
This module defines some utils related with mime type detection
Class Method Summary collapse
-
.get_mime_type(v) ⇒ String
Detect a file mime type.
-
.get_mime_type_from_uri(v) ⇒ String
Detect a file mime type from URI.
Class Method Details
.get_mime_type(v) ⇒ String
Detect a file mime type
11 12 13 |
# File 'lib/axlsx/util/mime_type_utils.rb', line 11 def self.get_mime_type(v) Marcel::MimeType.for(Pathname.new(v)) end |
.get_mime_type_from_uri(v) ⇒ String
Detect a file mime type from URI
18 19 20 |
# File 'lib/axlsx/util/mime_type_utils.rb', line 18 def self.get_mime_type_from_uri(v) Marcel::MimeType.for(URI.parse(v).open) end |