132件ヒット
[1-100件を表示]
(0.079秒)
ライブラリ
- csv (66)
- date (11)
- rss (44)
-
webrick
/ httpresponse (11)
クラス
- CSV (33)
-
CSV
:: FieldInfo (33) - Date (11)
-
RSS
:: Maker :: ChannelBase (22) -
RSS
:: Rss :: Channel (22) -
WEBrick
:: HTTPResponse (11)
キーワード
- [] (11)
- convert (22)
- header (11)
- index (11)
- lastBuildDate (22)
- lastBuildDate= (22)
- line (11)
-
unconverted
_ fields? (11)
検索結果
先頭5件
-
Date
# ld -> Integer (35102.0) -
リリウス日を返します。
リリウス日を返します。 -
RSS
:: Maker :: ChannelBase # lastBuildDate (12201.0) -
@todo
@todo -
RSS
:: Maker :: ChannelBase # lastBuildDate=() (12201.0) -
@todo
@todo -
RSS
:: Rss :: Channel # lastBuildDate (12201.0) -
@todo
@todo -
RSS
:: Rss :: Channel # lastBuildDate= (12201.0) -
@todo
@todo -
CSV
# unconverted _ fields? -> bool (6155.0) -
パースした結果が unconverted_fields というメソッドを持つ場合に真を返します。 そうでない場合は、偽を返します。
...が unconverted_fields というメソッドを持つ場合に真を返します。
そうでない場合は、偽を返します。
//emlist[例][ruby]{
require "csv"
csv = CSV.new("date1,date2\n2018-07-09,2018-07-10")
csv.unconverted_fields? # => nil
csv = CSV.new("date1,date2\n2018-07-09,2018-......07-10", unconverted_fields: false)
csv.unconverted_fields? # => false
csv = CSV.new("date1,date2\n2018-07-09,2018-07-10", headers: true, unconverted_fields: true)
csv.unconverted_fields? # => true
csv.convert(:date)
row = csv.readline
row.fields # => [#<Date: 2018-07-09 ((2458309j,0s,0n......),+0s,2299161j)>, #<Date: 2018-07-10 ((2458310j,0s,0n),+0s,2299161j)>]
row.unconverted_fields # => ["2018-07-09", "2018-07-10"]
//}
@see CSV.new... -
CSV
:: FieldInfo # header -> String | nil (3055.0) -
利用可能な場合はヘッダを表す文字列を返します。
...sv'
csv = CSV.new("date1,date2\n2018-07-09,2018-07-10", headers: true)
csv.convert do |field,field_info|
p field_info.header
Date.parse(field)
end
p csv.first
# => "date1"
# => "date2"
# => #<CSV::Row "date1":#<Date: 2018-07-09 ((2458309j,0s,0n),+0s,2299161j)> "date2":#<Date: 2018-07-10 ((2458... -
CSV
:: FieldInfo # line -> Integer (3055.0) -
行番号を返します。
...new("date1,date2,date3\n2018-07-09,2018-07-10\n2018-08-09,2018-08-10", headers: true)
csv.convert do |field,field_info|
p field_info.line
Date.parse(field)
end
p csv.to_a
# => 2
# => 2
# => 3
# => 3
# => [#<CSV::Row "date1":#<Date: 2018-07-09 ((2458309j,0s,0n),+0s,2299161j)> "date2":#<Date: 201......8-07-10 ((2458310j,0s,0n),+0s,2299161j)> "date3":nil>, ...]
//}... -
CSV
:: FieldInfo # index -> Integer (3043.0) -
行内で何番目のフィールドかわかるゼロベースのインデックスを返します。
...ire 'csv'
csv = CSV.new("date1,date2\n2018-07-09,2018-07-10", headers: true)
csv.convert do |field,field_info|
p field_info.index
Date.parse(field)
end
p csv.first
# => 0
# => 1
# => #<CSV::Row "date1":#<Date: 2018-07-09 ((2458309j,0s,0n),+0s,2299161j)> "date2":#<Date: 2018-07-10 ((2458310j,0s... -
CSV
# convert {|field , field _ info| . . . } (297.0) -
引数 name で指定した変換器かブロックに各フィールドを渡して文字列から別 のオブジェクトへと変換します。
...eldInfo のインス
タンスを受け取ります。ブロックは変換後の値かフィールドそのものを返さな
ければなりません。
@param name 変換器の名前を指定します。
//emlist[例 name で Converter を指定][ruby]{
require "csv"
csv = CSV.new("date1,date2......ert(:date)
csv.read # => 2018-07-09 ((2458309j,0s,0n),+0s,2299161j)>, #<Date: 2018-07-10 ((2458310j,0s,0n),+0s,2299161j)>
//}
//emlist[例 ブロックを指定][ruby]{
require "csv"
csv = CSV.new("date1,date2\n2018-07-09,2018-07-10", headers: true)
csv.convert do |field,field_info|
p field
p......ld_info
Date.parse(field)
end
p csv.first
# => "2018-07-09"
# => <struct CSV::FieldInfo index=0, line=2, header="date1">
# => "2018-07-10"
# => #<struct CSV::FieldInfo index=1, line=2, header="date2">
# => #<CSV::Row "date1":#<Date: 2018-07-09 ((2458309j,0s,0n),+0s,2299161j)> "date2":#<Date: 2018...