method
register
register(string, symbol, mime_type_synonyms = [], extension_synonyms = [], skip_lookup = false)
public
Hide source
# File actionpack/lib/action_dispatch/http/mime_type.rb, line 162 def register(string, symbol, mime_type_synonyms = [], extension_synonyms = [], skip_lookup = false) Mime.const_set(symbol.upcase, Type.new(string, symbol, mime_type_synonyms)) new_mime = Mime.const_get(symbol.upcase) SET << new_mime ([string] + mime_type_synonyms).each { |str| LOOKUP[str] = SET.last } unless skip_lookup ([symbol] + extension_synonyms).each { |ext| EXTENSION_LOOKUP[ext.to_s] = SET.last } @register_callbacks.each do |callback| callback.call(new_mime) end end