Class: String

Inherits:
Object
  • Object
show all
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(string, *flags) ⇒ Object



66
67
68
69
70
# File 'lib/filemagic/ext.rb', line 66

def self.file_type(string, *flags)
  FileMagic.fm(*flags).buffer(string)
rescue FileMagic::FileMagicError
  nil
end