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 179 def register(string, symbol, mime_type_synonyms = [], extension_synonyms = [], skip_lookup = false) new_mime = Type.new(string, symbol, mime_type_synonyms) SET << new_mime ([string] + mime_type_synonyms).each { |str| LOOKUP[str] = new_mime } unless skip_lookup ([symbol] + extension_synonyms).each { |ext| EXTENSION_LOOKUP[ext.to_s] = new_mime } @register_callbacks.each do |callback| callback.call(new_mime) end new_mime end