Class: MIME::Types

Inherits:
Object
  • Object
show all
Defined in:
lib/restclient/request.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.type_for_extension(ext) ⇒ Object



268
269
270
# File 'lib/restclient/request.rb', line 268

def type_for_extension ext
  @__types__.type_for_extension ext
end

Instance Method Details

#type_for_extension(ext) ⇒ Object

Return the first found content-type for a value considered as an extension or the value itself



262
263
264
265
# File 'lib/restclient/request.rb', line 262

def type_for_extension ext
  candidates = @extension_index[ext]
  candidates.empty? ? ext : candidates[0].content_type
end