るりまサーチ

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

別のキーワード

  1. openssl t61string
  2. asn1 t61string
  3. matrix t
  4. t61string new
  5. fiddle type_size_t

ライブラリ

クラス

モジュール

キーワード

検索結果

<< < 1 2 3 4 5 ... > >>

CSV#row_sep -> String (6244.0)

行区切り文字列として使用する文字列を返します。

...行区切り文字列として使用する文字列を返します。

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

csv = CSV.new("header1,header2|row1_1,row1_2", row_sep: "|")
csv.row_sep # => "|"
csv.read # => [["header1", "header2"], ["row1_1", "row1_2"]]
//}

@
see CSV.new...

Matrix#each_with_index(which = :all) {|e, row, col| ... } -> self (6226.0)

行列の各要素をその位置とともに引数としてブロックを呼び出します。

...Matrix#each と同じなのでそちらを参照してください。

ブロックを省略した場合、 Enumerator を返します。

//emlist[例][ruby]{
require 'matrix'
Matrix[ [1,2], [3,4] ].each_with_index do |e, row, col|
puts "#{e} at #{row}, #{col}"
end
# => 1 at 0, 0
# => 2 at 0...
..., 1
# => 3 at 1, 0
# => 4 at 1, 1
//}

@
param which どの要素に対してブロックを呼び出すのかを Symbol で指定します
@
see Matrix#each...

CGI::HtmlExtension#textarea(name = "", cols = 70, rows = 10) -> String (6220.0)

textarea 要素を生成します。

...textarea 要素を生成します。

@
param name name 属性の値を指定します。

@
param cols cols 属性の値を指定します。

@
param rows rows 属性の値を指定します。

例:
t
extarea("name")
# = textarea({ "NAME" => "name", "COLS" => 70, "ROWS" => 10 })...

CSV::Table#delete(index_or_header) -> object (6191.0)

指定された行か列を削除して返します。

...V::Table#by_col!,
CSV::Table#by_row! を使用してください。

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

row
1 = CSV::Row.new(["header1", "header2"], ["row1_1", "row1_2"])
row
2 = CSV::Row.new(["header1", "header2"], ["row2_1", "row2_2"])
t
able = CSV::Table.new([row1, row2])
t
able.delete(1)
t
able.to_a...
...# => [["header1", "header2"], ["row1_1", "row1_2"]]
//}

@
see CSV::Table#by_col!, CSV::Table#by_row!, CSV::Table#delete_if...

CSV#force_quotes? -> bool (6179.0)

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

...

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

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

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

//emlist[例][ruby]{
r...
...equire "csv"

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

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

@
see CSV.new...

絞り込み条件を変える

CSV#write_headers? -> bool (6155.0)

ヘッダを出力先に書き込む場合は真を返します。 そうでない場合は偽を返します。

...list[例][ruby]{
require "csv"

csv = CSV.new("date1,date2\n2018-07-09,2018-07-10")
csv.write_headers? # => nil

header = ["header1", "header2"]
row
= ["row1_1", "row1_2"]
result = CSV.generate(headers: header, write_headers: false) do |csv|
csv.write_headers? # => false
csv << row
end
result #...
...=> "row1_1,row1_2\n"

result = CSV.generate(headers: header, write_headers: true) do |csv|
csv.write_headers? # => true
csv << row
end
result # => "header1,header2\nrow1_1,row1_2\n"
//}

@
see CSV.new...

CSV#return_headers? -> bool (6143.0)

ヘッダを返す場合は、真を返します。 そうでない場合は、偽を返します。

...mlist[例][ruby]{
require "csv"

csv = CSV.new("header1,header2\nrow1_1,row1_2", headers: true, return_headers: false)
csv.return_headers? # => false
csv.shift # => #<CSV::Row "header1":"row1_1" "header2":"row1_2">

csv = CSV.new("header1,header2\nrow1_1,row1_2", headers: true, return_headers: true)...
...csv.return_headers? # => true
csv.shift # => #<CSV::Row "header1":"header1" "header2":"header2">
//}

@
see CSV.new...

CSV::Row#values_at(*headers_and_or_indices) -> Array (6131.0)

与えられた引数に対応する値の配列を返します。

...与えられた引数に対応する値の配列を返します。

要素の探索に CSV::Row#field を使用しています。

@
param headers_and_or_indices ヘッダの名前かインデックスか Range
のインスタンスか第 1 要素がヘッダの名前...
...るこ
とができます。

@
return 引数を与えなかった場合は全ての要素を返します。

require 'csv'
csv = CSV.new("a,b,c\n1,2,3", headers: true)
t
able = csv.read
row
= table.first
row
.values_at("a", 1, 2..3) # => ["1", "2", "3", nil]...

Matrix#each_with_index(which = :all) -> Enumerator (6126.0)

行列の各要素をその位置とともに引数としてブロックを呼び出します。

...Matrix#each と同じなのでそちらを参照してください。

ブロックを省略した場合、 Enumerator を返します。

//emlist[例][ruby]{
require 'matrix'
Matrix[ [1,2], [3,4] ].each_with_index do |e, row, col|
puts "#{e} at #{row}, #{col}"
end
# => 1 at 0, 0
# => 2 at 0...
..., 1
# => 3 at 1, 0
# => 4 at 1, 1
//}

@
param which どの要素に対してブロックを呼び出すのかを Symbol で指定します
@
see Matrix#each...
<< < 1 2 3 4 5 ... > >>