Class: File
- Inherits:
-
Object
- Object
- File
- Extended by:
- FileMagic::Ext::ClassMethods
- Includes:
- FileMagic::Ext::InstanceMethods
- Defined in:
- lib/filemagic/ext.rb
Class Method Summary collapse
Methods included from FileMagic::Ext::ClassMethods
content_type, file, file_type, mime_type
Methods included from FileMagic::Ext::InstanceMethods
#content_type, #file_type, #mime_type
Class Method Details
.file_type(file, *flags) ⇒ Object
53 54 55 56 57 |
# File 'lib/filemagic/ext.rb', line 53 def self.file_type(file, *flags) FileMagic.fm(*flags).file(file.respond_to?(:path) ? file.path : file) rescue FileMagic::FileMagicError nil end |