Class: MimeFallback::Type
- Inherits:
-
Mime::Type
- Object
- Mime::Type
- MimeFallback::Type
- Defined in:
- lib/mime_fallback/type.rb
Class Method Summary collapse
- .fallbacks(extension) ⇒ Object
- .register_alias(string, symbol, extension_synonyms = [], fallbacks = []) ⇒ Object
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 |