このマニュアルは既にメンテナンスが終了したバージョンの Ruby を対象としています。 最新版のマニュアルへ

Ruby 2.6.0 リファレンスマニュアル

instance method OpenURI::Meta#content_type

content_type -> String[permalink][rdoc]

対象となるリソースの Content-Type を文字列の配列で返します。Content-Type ヘッダの情報が使われます。 Content-Type ヘッダがない場合は、"application/octet-stream" を返します。

require 'open-uri'
open('http://www.ruby-lang.org/') {|f|
  p f.content_type  #=> "text/html"
}