るりまサーチ

最速Rubyリファレンスマニュアル検索!
37件ヒット [1-37件を表示] (0.082秒)
トップページ > クエリ:String[x] > クエリ:Encoding[x] > クエリ:name[x] > クエリ:generate[x]

別のキーワード

  1. stringio set_encoding
  2. _builtin set_encoding
  3. _builtin encoding
  4. rss encoding=
  5. rss encoding

種類

ライブラリ

クラス

キーワード

検索結果

CSV.generate(str = "", options = Hash.new) {|csv| ... } -> String (18238.0)

このメソッドは与えられた文字列をラップして CSV のオブジェクトとしてブロックに渡します。 ブロック内で CSV オブジェクトに行を追加することができます。 ブロックを評価した結果は文字列を返します。

...フォルトは空文字列です。

@param options CSV.new のオプションと同じオプションを指定できます。
:encoding というキーを使用すると出力のエンコーディングを指定することができます。
ASCII と互換性の無...
...require "csv"

text =<<-EOS
id,first name,last name,age
1,taro,tanaka,20
2,jiro,suzuki,18
3,ami,sato,19
4,yumi,adachi,21
EOS

csv = CSV.generate(text, headers: true) do |csv|
csv.add_row(["5", "saburo", "kondo", "34"])
end

print csv
# => id,first name,last name,age
# 1,taro,tanaka,20
# 2,jiro,suz...
...
要があります。

@param options CSV.new のオプションと同じオプションを指定できます。
:encoding というキーを使用すると出力のエンコーディングを指定することができます。
ASCII と互換性の無...

NEWS for Ruby 3.0.0 (300.0)

NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...", "f", 3]
in [*pre, String => x, String => y, *post]
p pre #=> ["a", 1]
p x #=> "b"
p y #=> "c"
p post #=> [2, "d", "e", "f", 3]
end
//}

* Endless method definition is added. [EXPERIMENTAL]
16746

//emlist{
def square(x) = x * x
//}

* Interpolated String literals are no lo...
...s a hash excluding the given keys and their values. 15822
* Windows: Read ENV names and values as UTF-8 encoded Strings 12650
* Encoding
* Added new encoding IBM720. 16233
* Changed default for Encoding.default_external to UTF-8 on Windows 16604
* Fiber
* Fiber.new(blocking: tr...
...rd`, `#to_i`, `#to_int`, `#zero?`
* `Struct`: reader methods for 10th or later members
* Constant references are inlined.
* Always generate appropriate code for `==`, `nil?`, and `!` calls depending on a receiver class.
* Reduce the number of PC accesses on branches and method re...

ruby 1.8.2 feature (120.0)

ruby 1.8.2 feature ruby 1.8.2 での ruby 1.8.1 からの変更点です。

...e= [lib] [new]
: OpenSSL::X509::StoreContext#time= [lib] [new]
追加。

: OpenSSL::X509::Name::RFC2253DN [lib] [new]
module for RFC2253 DN format.

: OpenSSL::X509::Name.parse_rfc2253 [lib] [new]
new method to parse RFC2253 DN format.

=== 2004-12-18

: Object#id [ruby]...
...((<ruby-core:03922>))

: String#inspect [ruby] [bug]
式展開になる '#'がエスケープされるようになりました。
((<ruby-core:03922>))
$ ruby1.8.1 -e "puts '# #{}'.inspect"
"# #{}"

$ ruby1.8.2 -e "puts '# #{}'.inspect"
"# \#{}"

: String#dump [ruby] [bug]
...
...ようになりました。((<ruby-dev:24528>))

=== 2004-10-18

: WEBrick::HTTPRequest [lib] [new]
new methods. accept, accept_charset, accept_encoding, accept_language,
content_length and content_type.

: WEBrick::HTTPResponse#content_length= [lib] [new]
: WEBrick::HTTPResponse#content_type=...

CSV.new(data, options = Hash.new) -> CSV (100.0)

このメソッドは CSV ファイルを読み込んだり、書き出したりするために String か IO のインスタンスをラップします。

...読み込んだり、書き出したりするために
String
か IO のインスタンスをラップします。

ラップされた文字列の先頭から読み込むことになります。
文字列に追記したい場合は CSV.generate を使用してください。
他の位置から処理...
...-ending translation can cause
problems with resetting the document position to where it was before the
read ahead. This String will be transcoded into the data's Encoding before parsing.
: :quote_char
フィールドをクオートする文字を指定します。長さ 1 の文字列でな...
...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", users)

File.open("test.csv", "r") do |f|
csv = CSV.new(f, headers: true)
csv.class # => CSV
csv.first # => #<CSV::Row "id":"1" "first name":"taro" "last name":"tanaka"...