るりまサーチ

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

別のキーワード

  1. rss content
  2. rss content=
  3. net/imap content_id
  4. item content
  5. item content=

検索結果

<< < 1 2 >>

CGI#header(options = "text/html") -> String (86.0)

HTTP ヘッダを options に従って生成します。 CGI#out と違い、標準出力には出力しません。 CGI#out を使わずに自力で HTML を出力したい場合などに使います。 このメソッドは文字列エンコーディングを変換しません。

...HTTP ヘッダを options に従って生成します。 CGI#out と違い、標準出力には出力しません。
CGI#out を使わずに自力で HTML を出力したい場合などに使います。
このメソッドは文字列エンコーディングを変換しません。

ヘッダのキ...
...能です。

: type
Content-Type ヘッダです。デフォルトは "text/html" です。
: charset
ボディのキャラクタセットを Content-Type ヘッダに追加します。
: nph
真偽値を指定します。真ならば、HTTP のバージョン、ステータスコード、...
...対応します。
: length
送信するコンテンツの長さを指定します。Content-Length ヘッダに対応します。
: language
送信するコンテンツの言語を指定します。Content-Language ヘッダに対応します。
: expires
送信するコンテンツの有効...

cgi (72.0)

CGI プログラムの支援ライブラリです。

...me # 元の名前
value.content_type # content_type
//}



==== クライアントにクッキーを渡す

//emlist[][ruby]{
require "cgi"
cgi = CGI.new
for name, cookie in cgi.cookies
cookie.expires = Time.now + 30
end
cgi.out("cookie" => cgi.cookies){"string"}...
...cgi.cookies # { "name1" => cookie1, "name2" => cookie2, ... }

require "cgi"
cgi = CGI.new
cgi.cookies['name'].expires = Time.now + 30
cgi.out("cookie" => cgi.cookies['name']){"string"}
//}

==== クライアントからクッキーを得る

//emlist[][ruby]{
require "cgi"
cgi = CGI.new
values = cg...
...YPE
* CONTENT_LENGTH
* CONTENT_TYPE
* GATEWAY_INTERFACE
* PATH_INFO
* PATH_TRANSLATED
* QUERY_STRING
* REMOTE_ADDR
* REMOTE_HOST
* REMOTE_IDENT
* REMOTE_USER
* REQUEST_METHOD
* SCRIPT_NAME
* SERVER_NAME
* SERVER_PORT
* SERVER_PROTOCOL
* SERVER_SOFTWARE

#content_lengt...

CSV.filter(input, options = Hash.new) {|row| ... } (30.0)

このメソッドは CSV データに対して Unix のツール群のようなフィルタを構築 するのに便利です。

...後に行を全て output に書き込
みます。

@param input String か IO のインスタンスを指定します。
デフォルトは ARGF です。

@param output String か IO のインスタンスを指定します。
デフォルトは $stdout です。

@param...
...ます。
":out_", ":output_" で始まるキーは output にだけ適用されます。
それ以外のキーは両方に適用されます。
":output_row_sep" のデフォルト値は $/ です。

//emlist[例: input, output は初期値][ruby]{
# $...
...header3
# row1_1,row1_2,row1_3
//}

//emlist[例: input, output を指定する][ruby]{
require "csv"
content
= <<EOS
id,first name,last name,age
1,taro,tanaka,20
2,jiro,suzuki,18
3,ami,sato,19
4,yumi,adachi,21
EOS

File.write('test.csv',content)
options = { headers: true, return_headers: true, writ...

CSV.filter(options = Hash.new) {|row| ... } (30.0)

このメソッドは CSV データに対して Unix のツール群のようなフィルタを構築 するのに便利です。

...後に行を全て output に書き込
みます。

@param input String か IO のインスタンスを指定します。
デフォルトは ARGF です。

@param output String か IO のインスタンスを指定します。
デフォルトは $stdout です。

@param...
...ます。
":out_", ":output_" で始まるキーは output にだけ適用されます。
それ以外のキーは両方に適用されます。
":output_row_sep" のデフォルト値は $/ です。

//emlist[例: input, output は初期値][ruby]{
# $...
...header3
# row1_1,row1_2,row1_3
//}

//emlist[例: input, output を指定する][ruby]{
require "csv"
content
= <<EOS
id,first name,last name,age
1,taro,tanaka,20
2,jiro,suzuki,18
3,ami,sato,19
4,yumi,adachi,21
EOS

File.write('test.csv',content)
options = { headers: true, return_headers: true, writ...

Forwardable (18.0)

クラスに対し、メソッドの委譲機能を定義するモジュールです。

...ないところに注意して下さい。

//emlist[例][ruby]{
require 'forwardable'

class Foo
extend Forwardable

def_delegators("@out", "printf", "print")
def_delegators(:@in, :gets)
def_delegator(:@contents, :[], "content_at")
end

f = Foo.new
f.printf ...
f.gets
f.content_at(1)
//}...

絞り込み条件を変える

ruby 1.6 feature (18.0)

ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。

...を返していた
p "foo".slice!(5,10)

=> ruby 1.6.7 (2002-03-01) [i586-linux]
nil
-:2:in `slice!': index 5 out of string (IndexError)
from -:2
=> ruby 1.6.7 (2002-08-01) [i586-linux]
nil
nil

: 2002-07-05 String#...
...ruby 1.6.4 (2001-06-04) [i586-linux]
Content
-Type: text/plain; charset=iso-8859-1
^M
TEXT_PLAIN: text/plain; charset=iso-8859-1
TEXT_PLAIN: text/plain

=> ruby 1.6.5 (2001-09-19) [i586-linux]
Content
-Type: text/plain; charset=iso-8859-1...
...たリゾルバは、timeout の制御が効きます(つまり、名前解
決中にThreadが切替え可能ということです)

require 'resolv'
p Resolv.new.getaddress("www.ruby-lang.org").to_s

=> /usr/local/lib/ruby/1.6/resolv.rb:160: warning: timeout (...) interpreted as metho...
<< < 1 2 >>