method
new
v7.1.3.4 -
Show latest stable
- Class:
Mime::Type
new(string, symbol = nil, synonyms = [])public
No documentation available.
# File actionpack/lib/action_dispatch/http/mime_type.rb, line 257
def initialize(string, symbol = nil, synonyms = [])
unless MIME_REGEXP.match?(string)
raise InvalidMimeType, "#{string.inspect} is not a valid MIME type"
end
@symbol, @synonyms = symbol, synonyms
@string = string
@hash = [@string, @synonyms, @symbol].hash
end