Class: MimeFallback::Type

Inherits:
Mime::Type
  • Object
show all
Defined in:
lib/mime_fallback/type.rb

Class Method Summary collapse

Class Method Details

.fallbacks(extension) ⇒ Object



15
16
17
# File 'lib/mime_fallback/type.rb', line 15

def fallbacks(extension)
  Array(FALLBACKS[extension.to_s])
end

.register_alias(string, symbol, extension_synonyms = [], fallbacks = []) ⇒ Object



10
11
12
13
# File 'lib/mime_fallback/type.rb', line 10

def register_alias(string, symbol, extension_synonyms = [], fallbacks = [])
  FALLBACKS[symbol.to_s] = Array(fallbacks).map {|s| Mime::Type.lookup_by_extension(s.to_s) } unless Array(fallbacks).empty?
  super(string, symbol, extension_synonyms)
end