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

Class Method Details

.get_mime_type(v) ⇒ String

Detect a file mime type

Parameters:

  • v (String)

    File path

Returns:

  • (String)

    File mime type


7
8
9
# File 'lib/axlsx/util/mime_type_utils.rb', line 7

def self.get_mime_type(v)
  MimeMagic.by_magic(File.open(v)).to_s
end