Class: ChupaText::MIMETypeRegistry

Inherits:
Object
  • Object
show all
Defined in:
lib/chupa-text/mime-type-registry.rb

Instance Method Summary collapse

Constructor Details

#initializeMIMETypeRegistry

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

#clearObject



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