Class: MIME::Types
- Inherits:
-
Object
- Object
- MIME::Types
- Defined in:
- lib/restclient/request.rb
Class Method Summary (collapse)
Instance Method Summary (collapse)
-
- (Object) type_for_extension(ext)
Return the first found content-type for a value considered as an extension or the value itself.
Class Method Details
+ (Object) type_for_extension(ext)
311 312 313 |
# File 'lib/restclient/request.rb', line 311 def type_for_extension ext @__types__.type_for_extension ext end |
Instance Method Details
- (Object) type_for_extension(ext)
Return the first found content-type for a value considered as an extension or the value itself
305 306 307 308 |
# File 'lib/restclient/request.rb', line 305 def type_for_extension ext candidates = @extension_index[ext] candidates.empty? ? ext : candidates[0].content_type end |