Module: Waves::MimeTypes

Defined in:
lib/runtime/mime_types.rb

Overview

Waves::MimeTypes defines an interface for adding MIME types used in mapping requests to content types. Mongrel’s MIME_TYPES hash is used as the baseline MIME map.

Class Method Summary collapse

Class Method Details

.<<(mapping) ⇒ Object

TODO: This does not seem to be working.



13
14
15
# File 'lib/runtime/mime_types.rb', line 13

def self.<<( mapping )
  mapping.merge!( mapping )
end

.[](path) ⇒ Object



8
9
10
# File 'lib/runtime/mime_types.rb', line 8

def self.[]( path )
  mapping[ File.extname( path ) ]
end

.mappingObject



17
18
19
# File 'lib/runtime/mime_types.rb', line 17

def self.mapping
  @mapping ||= Mongrel::DirHandler::MIME_TYPES
end