るりまサーチ

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

別のキーワード

  1. kernel require
  2. getoptlong require_order
  3. rubygems/custom_require require
  4. irb/ext/use-loader irb_require
  5. require execute

ライブラリ

モジュール

キーワード

検索結果

<< 1 2 3 > >>

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

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

...//emlist[][ruby]{
require
'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
//}...

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

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

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

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

//emlist[例][ruby]{
require
'open-uri'
URI.open('http://www.ruby-lang.org/') {|f|
p f.content_type #...

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

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

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

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

//emlist[例][ruby]{
require
'net/http'

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

OpenURI::Meta#content_encoding -> [String] (6247.0)

対象となるリソースの Content-Encoding を文字列の配列として返します。 Content-Encoding ヘッダがない場合は、空の配列を返します。

...象となるリソースの Content-Encoding を文字列の配列として返します。
Content
-Encoding ヘッダがない場合は、空の配列を返します。

例:

//emlist[例][ruby]{
require
'open-uri'
open('http://example.com/f.tar.gz') {|f|
p f.content_encoding #=> ["x-gzip"]
}
//...
...象となるリソースの Content-Encoding を文字列の配列として返します。
Content
-Encoding ヘッダがない場合は、空の配列を返します。

例:

//emlist[例][ruby]{
require
'open-uri'
URI.open('http://example.com/f.tar.gz') {|f|
p f.content_encoding #=> ["x-gzip"]...

WEBrick::HTTPResponse#content_length -> Integer | nil (6191.0)

Content-Length ヘッダの値を整数で表すアクセサです。デフォルトは nil です。

...
Content
-Length ヘッダの値を整数で表すアクセサです。デフォルトは nil です。

: body が String オブジェクトである場合
content
_length の値が nil のとき Content-Length ヘッダには
body のサイズが使われます。nil でないとき body の実...
...IO オブジェクトである場合
content
_length の値が nil のとき Content-Length ヘッダはレスポンスに含まれず、IO から全てを読み込ん
でそれをエンティティボディとします。nil でないとき IO から content_length バイトだけ読み込み...
...
エンティティボディとします。

また 2616 4.4 で定められた Content-Length ヘッダを送ってはいけない場合に当てはまる時には
content
_length の値は無視され Content-Length ヘッダはレスポンスに含まれません。

@param len ヘッダの...

絞り込み条件を変える

WEBrick::HTTPResponse#content_length=(len) (6191.0)

Content-Length ヘッダの値を整数で表すアクセサです。デフォルトは nil です。

...
Content
-Length ヘッダの値を整数で表すアクセサです。デフォルトは nil です。

: body が String オブジェクトである場合
content
_length の値が nil のとき Content-Length ヘッダには
body のサイズが使われます。nil でないとき body の実...
...IO オブジェクトである場合
content
_length の値が nil のとき Content-Length ヘッダはレスポンスに含まれず、IO から全てを読み込ん
でそれをエンティティボディとします。nil でないとき IO から content_length バイトだけ読み込み...
...
エンティティボディとします。

また 2616 4.4 で定められた Content-Length ヘッダを送ってはいけない場合に当てはまる時には
content
_length の値は無視され Content-Length ヘッダはレスポンスに含まれません。

@param len ヘッダの...

Net::HTTPHeader#fetch(key) -> String (158.0)

key ヘッダフィールドを返します。

...key ヘッダフィールドを返します。

たとえばキー 'content-length' に対しては '2048'
のような文字列が得られます。キーが存在しなければ nil を返します。

該当するキーが登録されてい
ない時には、引数 default が与えられてい...
...在する][ruby]{
require
'net/http'

uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.fetch("user-agent") # => "Ruby"
//}

//emlist[例 key のみ指定。key が存在しない][ruby]{
require
'net/http'

begin
req.fetch("content-length")
rescue...
...=> e
e # => #<KeyError: key not found: "content-length">
end
//}

//emlist[例 key , default を指定][ruby]{
require
'net/http'

uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.fetch("content-length", "default") # => "default"
//}

//emlist[例...

Net::HTTPHeader#fetch(key) {|hash| .... } -> String (158.0)

key ヘッダフィールドを返します。

...key ヘッダフィールドを返します。

たとえばキー 'content-length' に対しては '2048'
のような文字列が得られます。キーが存在しなければ nil を返します。

該当するキーが登録されてい
ない時には、引数 default が与えられてい...
...在する][ruby]{
require
'net/http'

uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.fetch("user-agent") # => "Ruby"
//}

//emlist[例 key のみ指定。key が存在しない][ruby]{
require
'net/http'

begin
req.fetch("content-length")
rescue...
...=> e
e # => #<KeyError: key not found: "content-length">
end
//}

//emlist[例 key , default を指定][ruby]{
require
'net/http'

uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.fetch("content-length", "default") # => "default"
//}

//emlist[例...

Net::HTTPHeader#fetch(key, default) -> String (158.0)

key ヘッダフィールドを返します。

...key ヘッダフィールドを返します。

たとえばキー 'content-length' に対しては '2048'
のような文字列が得られます。キーが存在しなければ nil を返します。

該当するキーが登録されてい
ない時には、引数 default が与えられてい...
...在する][ruby]{
require
'net/http'

uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.fetch("user-agent") # => "Ruby"
//}

//emlist[例 key のみ指定。key が存在しない][ruby]{
require
'net/http'

begin
req.fetch("content-length")
rescue...
...=> e
e # => #<KeyError: key not found: "content-length">
end
//}

//emlist[例 key , default を指定][ruby]{
require
'net/http'

uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.fetch("content-length", "default") # => "default"
//}

//emlist[例...
<< 1 2 3 > >>