るりまサーチ (Ruby 2.3.0)

最速Rubyリファレンスマニュアル検索!
1件ヒット [1-1件を表示] (0.065秒)
トップページ > バージョン:2.3.0[x] > 種類:インスタンスメソッド[x] > クエリ:l[x] > ライブラリ:csv[x] > クラス:CSV[x] > クエリ:force_quotes?[x]

別のキーワード

  1. csv force_quotes?
  2. lazy force
  3. options force_output
  4. options force_update
  5. options force_output=

検索結果

CSV#force_quotes? -> bool (54652.0)

出力される全てのフィールドがクオートされる場合は、真を返します。

...]{
require "csv"

rows = [["header1", "header2"], ["row1_1,", "row1_2"]]
result = CSV.generate(force_quotes: false) do |csv|
rows.each { |row| csv << row }
csv
.force_quotes? # => false
end
print result

# => header1,header2
# "row1_1,",row1_2
//}

//emlist[例][ruby]{
require "csv"

rows = [[...
..."header1", "header2"], ["row1_1,", "row1_2"]]
result = CSV.generate(force_quotes: true) do |csv|
rows.each { |row| csv << row }
csv
.force_quotes? # => true
end
print result

# => true
# => "header1","header2"
# "row1_1,","row1_2"
//}

@see CSV.new...