class method
self.lookup
Ruby on Rails edge
Signature
self.lookup(string)
No documentation comment.
Parameters
-
stringreq
Source
# File actionpack/lib/action_dispatch/http/mime_type.rb, line 237
def lookup(string)
lookup = Mime.lookup_by_string
return lookup[string] if lookup.key?(string)
# fallback to the media-type without parameters if it was not found
string = string.split(";", 2)[0]&.rstrip
lookup[string] || Type.new(string)
end
Defined in actionpack/lib/action_dispatch/http/mime_type.rb line 237
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in Mime::Type