# File lib/mime/content_types.rb, line 87 def file_type file filename = file.respond_to?(:path) ? file.path : file extension = File.extname(filename)[1..-1] # array index removes period typ_exts = CONTENT_TYPES.find {|type, extentions| extentions.include? extension} typ_exts ? typ_exts.first : typ_exts # returns +type+ from above or nil end