るりまサーチ

最速Rubyリファレンスマニュアル検索!
1182件ヒット [1-100件を表示] (0.187秒)
トップページ > クエリ:-[x] > クエリ:r[x] > クエリ:content[x]

別のキーワード

  1. _builtin -
  2. open-uri open
  3. irb/input-method new
  4. irb/input-method gets
  5. matrix -

検索結果

<< 1 2 3 ... > >>

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

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

...][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\" hre...
...f=\"style.css\""
doc[4].target # => "foobar"
doc[4].content # => nil
//}...

RDoc::Markup#content -> String (21301.0)

変換する文字列を返します。

...

r
doc ライブラリのデバッグ用途に使用します。
SM::SimpleMarkup#convert の後に実行します。

変換のために加工したオブジェクトを改行で連結したものを返すため、変換前
の文字列と結果が異なる事があります。

@see SM::SimpleMark...
...up#convert...

Net::HTTPHeader#content_range -> Range|nil (12463.0)

Content-Range: ヘッダフィールドの値を Range で返します。 Range の表わす長さは Net::HTTPHeader#range_length で得られます。

...
Content
-Range: ヘッダフィールドの値を Range で返します。
R
ange の表わす長さは Net::HTTPHeader#range_length で得られます。

ヘッダが設定されていない場合には nil を返します。

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

uri = URI.parse('http://www.exa...
...mple.com/index.html')
r
eq = Net::HTTP::Get.new(uri.request_uri)
r
eq.content_range # => nil
r
eq['Content-Range'] = "bytes 0-499/1234"
r
eq.content_range # => 0..499
//}...

open-uri (12108.0)

http/ftp に簡単にアクセスするためのクラスです。 Kernel.#open を再定義します。

...スです。
Kernel.#open を再定義します。

=== 使用例

http/ftp の URL を、普通のファイルのように開けます。

r
equire 'open-uri'
open("http://www.ruby-lang.org/") {|f|
f.each_line {|line| p line}
}

開いたファイルオブジェクトは StringIO もしく...
...が OpenURI::Meta モジュールで拡張されていて、メタ情報を獲得する
メソッドが使えます。

r
equire 'open-uri'
open("http://www.ruby-lang.org/en") {|f|
f.each_line {|line| p line}
p f.base_uri # <URI::HTTP:0x40e6ef2 URL:http://www.ruby-lang.org/en/>...
...arset # "iso-8859-1"
p f.content_encoding # []
p f.last_modified # Thu Dec 05 02:45:02 UTC 2002
}

ハッシュ引数で、追加のヘッダフィールドを指定できます。

r
equire 'open-uri'
open("http://www.ruby-lang.org/en/",
"User-Agent" => "Ruby/#{RUBY_VER...
...用例

http/ftp の URL を、普通のファイルのように開けます。

r
equire 'open-uri'
URI.open("http://www.ruby-lang.org/") {|f|
f.each_line {|line| p line}
}

開いたファイルオブジェクトは StringIO もしくは Tempfile で
すが OpenURI::Meta モジュール...
...ます。

r
equire 'open-uri'
URI.open("http://www.ruby-lang.org/en") {|f|
f.each_line {|line| p line}
p f.base_uri # <URI::HTTP:0x40e6ef2 URL:http://www.ruby-lang.org/en/>
p f.content_type # "text/html"
p f.charset # "iso-8859-1"
p f.content_encoding # [...
...ールドを指定できます。

r
equire 'open-uri'
URI.open("http://www.ruby-lang.org/en/",
"User-Agent" => "Ruby/#{RUBY_VERSION}",
"From" => "foo@bar.invalid",
"Referer" => "http://www.ruby-lang.org/") {|f|
...
}

http_proxy, ftp_proxy, no_proxy などの環境変数は、...

rubygems/commands/contents_command (12066.0)

インストールされている Gem パッケージに含まれているファイルリストを表示するためのライブラリです。

...em contents GEMNAME [options]
Options:
-
v, --version VERSION 指定されたバージョンの Gem パッケージの内容を表示します
-
s, --spec-dir a,b,c 指定されたパス以下にある Gem パッケージを検索します
-
l, --[no-]lib-on...
...します
Common Options:
-
h, --help このコマンドのヘルプを表示します
-
V, --[no-]verbose 表示を詳細にします
-
q, --quiet 静かに実行します
-
-config-file FILE 指定され...
...用します
-
-backtrace バックトレースを表示します
-
-debug Ruby 自体のデバッグオプションを有効にします
Arguments:
GEMNAME Gem パッケージの名前を指定します
Summary:
...

絞り込み条件を変える

OpenURI::Meta#content_type -> String (9431.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 #=> "...
...ースの 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 #...

WEBrick::HTTPResponse#content_length -> Integer | nil (9430.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 バイトだけ読み込み...
... Content-Length ヘッダを送ってはいけない場合に当てはまる時には
content
_length の値は無視され Content-Length ヘッダはレスポンスに含まれません。

@param len ヘッダの値を整数で指定します。nil を指定することは出来ません。

r
eq...

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

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

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

例:

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

例:

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

OpenURI.open_uri(name, mode = &#39;r&#39;, perm = nil, options = {}) -> StringIO (9380.0)

URI である文字列 name のリソースを取得して StringIO オブジェクト として返します。

...URI である文字列 name のリソースを取得して StringIO オブジェクト
として返します。

ブロックを与えた場合は StringIO オブジェクトを引数としてブロックを
評価します。ブロックの終了時に StringIO は close されます。nil を返...
...

r
equire 'open-uri'
sio = OpenURI.open_uri('http://www.example.com')
p sio.last_modified
puts sio.read

OpenURI.open_uri('http://www.example.com'){|sio| sio.read }

options には Hash を与えます。理解するハッシュの
キーは以下のシンボル、
* :proxy
* :progres...
...s_proc
* :content_length_proc
* :http_basic_authentication
* :proxy_http_basic_authentication
* :read_timeout
* :ssl_ca_cert
* :ssl_verify_mode
* :ftp_active_mode
* :redirect
です。
「:content_length_proc」と「:progress_proc」はプログレスバーに
利用されることを想定...

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

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

... 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
e...
...q.content_type # => nil
r
eq.content_type = 'multipart/form-data'
r
eq.content_type # => "multipart/form-data"
//}...

絞り込み条件を変える

<< 1 2 3 ... > >>