るりまサーチ

最速Rubyリファレンスマニュアル検索!
384件ヒット [1-100件を表示] (0.192秒)

別のキーワード

  1. fiddle ruby_free
  2. rbconfig ruby
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

ライブラリ

クラス

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

REXML::Instruction#content -> String | nil (27338.0)

XML 処理命令の内容を返します。

...mlist[][ruby]{
r
equire 'rexml/document'
doc = REXML::Document.new(<<EOS)
<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/css" href="style.css"?>
<?foobar?>
<root />
EOS
doc[2] # => <?p-i xml-stylesheet ...?>
doc[2].target # => "xml-stylesheet"
doc[2].content # => "type=\"text/css...
...\" href=\"style.css\""
doc[4].target # => "foobar"
doc[4].content # => nil
//}...

Net::HTTPHeader#set_content_type(type, params = {}) (24709.0)

type と params から Content-Type: ヘッダフィールドの 値を設定します。

...type と params から Content-Type: ヘッダフィールドの
値を設定します。

@param type メディアタイプを文字列で指定します。
@param params パラメータ属性をハッシュで指定します。

//emlist[例][ruby]{
r
equire 'net/http'

uri = URI.parse('http://www....
...example.com/index.html')
r
eq = Net::HTTP::Get.new(uri.request_uri)
r
eq.content_type # => nil
r
eq.content_type = 'multipart/form-data' # => "multipart/form-data"
r
eq.content_type # => "multipart/form-data"
//}...

OpenURI::Meta#content_type -> String (21535.0)

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

... Content-Type を文字列で返します。Content-Type ヘッダの情報が使われます。
Content
-Type ヘッダがない場合は、"application/octet-stream" を返します。

//emlist[例][ruby]{
r
equire 'open-uri'
open('http://www.ruby-lang.org/') {|f|
p f.content_type #=> "text/html...
... Content-Type を文字列で返します。Content-Type ヘッダの情報が使われます。
Content
-Type ヘッダがない場合は、"application/octet-stream" を返します。

//emlist[例][ruby]{
r
equire 'open-uri'
URI.open('http://www.ruby-lang.org/') {|f|
p f.content_type #=> "text/...
...html"
}
//}...

Net::HTTPHeader#content_type=(type) (21509.0)

type と params から Content-Type: ヘッダフィールドの 値を設定します。

...type と params から Content-Type: ヘッダフィールドの
値を設定します。

@param type メディアタイプを文字列で指定します。
@param params パラメータ属性をハッシュで指定します。

//emlist[例][ruby]{
r
equire 'net/http'

uri = URI.parse('http://www....
...example.com/index.html')
r
eq = Net::HTTP::Get.new(uri.request_uri)
r
eq.content_type # => nil
r
eq.content_type = 'multipart/form-data' # => "multipart/form-data"
r
eq.content_type # => "multipart/form-data"
//}...

Net::HTTPHeader#content_type -> String|nil (21495.0)

"text/html" のような Content-Type を表す 文字列を返します。

..."text/html" のような Content-Type を表す
文字列を返します。

Content
-Type: ヘッダフィールドが存在しない場合には nil を返します。

//emlist[例][ruby]{
r
equire 'net/http'

uri = URI.parse('http://www.example.com/comments.cgi?post=comment')
r
eq = Net::HTTP::Post...
....new(uri.request_uri)
r
eq.content_type # => nil
r
eq.content_type = 'multipart/form-data'
r
eq.content_type # => "multipart/form-data"
//}...

絞り込み条件を変える

Net::HTTPHeader#type_params -> Hash (18364.0)

Content-Type のパラメータを {"charset" => "iso-2022-jp"} という形の Hash で返します。

...Content-Type のパラメータを {"charset" => "iso-2022-jp"}
という形の Hash で返します。

Content
-Type: ヘッダフィールドが存在しない場合には
空のハッシュを返します。

//emlist[例][ruby]{
r
equire 'net/http'

uri = URI.parse('http://www.example.com/index.h...
...tml')
r
es = Net::HTTP.get_response(uri)
r
es.type_params # => {"charset"=>"UTF-8"}
//}...

Net::HTTPHeader#main_type -> String|nil (15332.0)

"text/html" における "text" のようなタイプを表す 文字列を返します。

..."text/html" における "text" のようなタイプを表す
文字列を返します。

Content
-Type: ヘッダフィールドが存在しない場合には nil を返します。

//emlist[例][ruby]{
r
equire 'net/http'

uri = URI.parse('http://www.example.com/index.html')
r
es = Net::HTTP.get_r...
...esponse(uri)
r
es.main_type # => "text"
//}...

Net::HTTPHeader#sub_type -> String|nil (15332.0)

"text/html" における "html" のようなサブタイプを表す 文字列を返します。

..."text/html" における "html" のようなサブタイプを表す
文字列を返します。

Content
-Type: ヘッダフィールドが存在しない場合には nil を返します。

//emlist[例][ruby]{
r
equire 'net/http'

uri = URI.parse('http://www.example.com/index.html')
r
es = Net::HTTP...
....get_response(uri)
r
es.sub_type # => "html"
//}...

OpenURI::Meta#charset -> String | nil (12281.0)

対象となるリソースの文字コードを文字列で返します。Content-Type ヘッダの文字コード情報が使われます。 文字列は小文字へと変換されています。

...対象となるリソースの文字コードを文字列で返します。Content-Type ヘッダの文字コード情報が使われます。
文字列は小文字へと変換されています。

Content
-Type ヘッダがない場合は、nil を返します。ただし、ブロックが与え...
...URI のスキームが HTTP であり、自身のタイプが text である場合は、
2616 3.7.1 で定められているとおり、文字列 "iso-8859-1" を返します。

//emlist[例][ruby]{
r
equire 'open-uri'
open("http://www.ruby-lang.org/en") {|f|
p f.content_type # => "text/html"...
...p f.charset # => "iso-8859-1"
}
//}...
...URI のスキームが HTTP であり、自身のタイプが text である場合は、
2616 3.7.1 で定められているとおり、文字列 "iso-8859-1" を返します。

//emlist[例][ruby]{
r
equire 'open-uri'
URI.open("http://www.ruby-lang.org/en") {|f|
p f.content_type # => "text/html...
..."
p f.charset # => "iso-8859-1"
}
//}...
<< 1 2 3 ... > >>