Class: ChupaText::MIMETypeRegistry
- Inherits:
-
Object
- Object
- ChupaText::MIMETypeRegistry
- Defined in:
- lib/chupa-text/mime-type-registry.rb
Instance Method Summary collapse
- #clear ⇒ Object
- #find(extension) ⇒ Object
-
#initialize ⇒ MIMETypeRegistry
constructor
A new instance of MIMETypeRegistry.
- #register(extension, mime_type) ⇒ Object
Constructor Details
#initialize ⇒ MIMETypeRegistry
Returns a new instance of MIMETypeRegistry.
19 20 21 |
# File 'lib/chupa-text/mime-type-registry.rb', line 19 def initialize @from_extension_map = {} end |
Instance Method Details
#clear ⇒ Object
31 32 33 |
# File 'lib/chupa-text/mime-type-registry.rb', line 31 def clear @from_extension_map.clear end |
#find(extension) ⇒ Object
27 28 29 |
# File 'lib/chupa-text/mime-type-registry.rb', line 27 def find(extension) @from_extension_map[normalize_extension(extension)] end |
#register(extension, mime_type) ⇒ Object
23 24 25 |
# File 'lib/chupa-text/mime-type-registry.rb', line 23 def register(extension, mime_type) @from_extension_map[normalize_extension(extension)] = mime_type end |