Module: FileMagic::Ext::ClassMethods

Defined in:
lib/filemagic/ext.rb

Instance Method Summary collapse

Instance Method Details

#content_type(file, *flags) ⇒ Object



28
29
30
# File 'lib/filemagic/ext.rb', line 28

def content_type(file, *flags)
  mime_type(file, *flags << { simplified: true })
end

#file(file, *flags) ⇒ Object



18
19
20
# File 'lib/filemagic/ext.rb', line 18

def file(file, *flags)
  file_type(file, *flags)
end

#file_type(file, *flags) ⇒ Object

Raises:

  • (NotImplementedError)


14
15
16
# File 'lib/filemagic/ext.rb', line 14

def file_type(file, *flags)
  raise NotImplementedError, 'must be implemented by including class'
end

#mime_type(file, *flags) ⇒ Object Also known as: mime



22
23
24
# File 'lib/filemagic/ext.rb', line 22

def mime_type(file, *flags)
  file_type(file, *flags.unshift(:mime))
end