Class: Allure::ContentType
- Inherits:
-
Object
- Object
- Allure::ContentType
- Defined in:
- lib/allure_ruby_commons/model/content_type.rb
Overview
Commonly used mime type definitions
Constant Summary collapse
- TXT =
"text/plain"
- XML =
"application/xml"
- CSV =
"text/csv"
- TSV =
"text/tab-separated-values"
- CSS =
"text/css"
- URI =
"text/uri-list"
- SVG =
"image/svg+xml"
- PNG =
"image/png"
- JSON =
"application/json"
- WEBM =
"video/webm"
- JPG =
"image/jpeg"
Class Method Summary collapse
-
.to_extension(content_type) ⇒ String
Get file extension from mime type.
Class Method Details
.to_extension(content_type) ⇒ String
Get file extension from mime type
23 24 25 |
# File 'lib/allure_ruby_commons/model/content_type.rb', line 23 def self.to_extension(content_type) MIME::Types[content_type]&.first&.preferred_extension end |