るりまサーチ

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

別のキーワード

  1. openssl new
  2. _builtin new
  3. rexml/document new
  4. resolv new
  5. socket new

ライブラリ

クラス

検索結果

<< < ... 2 3 4 >>

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

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

..."language" => "ja",
"expires" => Time.now + 30,
"cookie" => [cookie1, cookie2],
"my_header1" => "my_value",
"my_header2" => "my_value"})

例:
cgi = CGI.new('html3')
print cgi.header({"charset" => "shift_jis"...

CGI#out(options = "text/html") { .... } (12.0)

HTTP ヘッダと、ブロックで与えられた文字列を標準出力に出力します。

..."ja"にします。

@param options Hash か文字列で HTTP ヘッダを生成するための情報を指定します。

例:
cgi = CGI.new
cgi.out{ "string" }
# Content-Type: text/html
# Content-Length: 6
#
# string

cgi.out("text...
...-jp",
# Content-Type: text/html; charset=iso-2022-jp
"language" => "ja",
"expires" => Time.now + (3600 * 24 * 30),
"cookie" => [cookie1, cookie2],
"my_header1" => "my_value",
"my_header2"...

CSV (12.0)

このクラスは CSV ファイルやデータに対する完全なインターフェイスを提供します。

...tderr) { |csv_err| csv_err << %w{my data here} } # to $stderr
//}

=== CSV と文字エンコーディング (M17n or Multilingualization)

This new CSV parser is m17n savvy. The parser works in the Encoding of the IO
or String object being read from or written to. Your data is never transcode...
...u can set these values manually in
the target Encoding to avoid the translation.

It's also important to note that while all of CSV's core parser is now
Encoding agnostic, some features are not. For example, the built-in
converters will try to transcode data to UTF-8 before making conversions.
Agai...

DateTime (12.0)

日付だけでなく時刻も扱える Date のサブクラスです。

...を使うことを推奨します。

=== 簡単なつかいかた

require 'date'

a = DateTime.new(1993, 2, 24, 12, 30, 45)
b = DateTime.parse('1993-02-24T12:30:45')
b += 10

b - a #=> 10
b.year #=> 1993
b.strftime('%a') #=> "Sat"

yesterday = DateTime.now - 1...
<< < ... 2 3 4 >>