種類
- インスタンスメソッド (33)
- 文書 (26)
ライブラリ
- csv (33)
クラス
- CSV (33)
キーワード
-
NEWS for Ruby 2
. 0 . 0 (11) -
NEWS for Ruby 3
. 0 . 0 (4) - readline (11)
- shift (11)
- 制御構造 (11)
検索結果
先頭5件
-
CSV
# gets -> Array | CSV :: Row (24207.0) -
String や IO をラップしたデータソースから一行だけ読み込んで フィールドの配列か CSV::Row のインスタンスを返します。
...しない場合は配列を返します。
ヘッダを使用する場合は CSV::Row を返します。
//emlist[例][ruby]{
require "csv"
csv = CSV.new(DATA.read)
csv.readline # => ["header1", "header2"]
csv.readline # => ["row1_1", "row1_2"]
__END__
header1,header2
row1_1,row1_2
//}... -
CSV
# readline -> Array | CSV :: Row (6007.0) -
String や IO をラップしたデータソースから一行だけ読み込んで フィールドの配列か CSV::Row のインスタンスを返します。
...しない場合は配列を返します。
ヘッダを使用する場合は CSV::Row を返します。
//emlist[例][ruby]{
require "csv"
csv = CSV.new(DATA.read)
csv.readline # => ["header1", "header2"]
csv.readline # => ["row1_1", "row1_2"]
__END__
header1,header2
row1_1,row1_2
//}... -
CSV
# shift -> Array | CSV :: Row (6007.0) -
String や IO をラップしたデータソースから一行だけ読み込んで フィールドの配列か CSV::Row のインスタンスを返します。
...しない場合は配列を返します。
ヘッダを使用する場合は CSV::Row を返します。
//emlist[例][ruby]{
require "csv"
csv = CSV.new(DATA.read)
csv.readline # => ["header1", "header2"]
csv.readline # => ["row1_1", "row1_2"]
__END__
header1,header2
row1_1,row1_2
//}... -
NEWS for Ruby 3
. 0 . 0 (72.0) -
NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...*
* Can be sliced with Enumerator::ArithmeticSequence
//emlist[][ruby]{
dirty_data = ['--', 'data1', '--', 'data2', '--', 'data3']
dirty_data[(1..).step(2)] # take each second element
# => ["data1", "data2", "data3"]
//}
* Binding
* Binding#eval when called with one argument will use `"(......IO#nonblock? now defaults to `true`. 16786
* IO#wait_readable, IO#wait_writable, IO#read, IO#write and other related methods (e.g. IO#puts, IO#gets) may invoke the scheduler hook `#io_wait(io, events, timeout)` in a non-blocking execution context. 16786
* Kernel
* Kernel#clone when called......Net::HTTP#verify_hostname= and Net::HTTP#verify_hostname have been added to skip hostname verification. 16555
* Net::HTTP.get, Net::HTTP.get_response, and Net::HTTP.get_print can take the request headers as a Hash in the second argument when the first argument is a URI. 16686
* Net::SMTP... -
NEWS for Ruby 2
. 0 . 0 (48.0) -
NEWS for Ruby 2.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...を導入しました。期待しないスタックオーバーフローを避けるためです
* GC::Profiler
* 追加: GC::Profiler.raw_data GCの加工していないプロファイルデータを返します
* Hash
* 追加: Hash#to_h 明示的に変換するメソッドです。A......d は UnboundMethod を受け付けるようになりました
* 拡張: Module#const_get 修飾された定数名の文字列を受け付けるようになりました。
//emlist{
Object.const_get("Foo::Bar::Baz")
//}
* Mutex
* 追加(実験的): Mutex#owned? mutex が現在の......* Process
* 追加: Process#getsid session id を取得します(unix のみ)。
* Range
* 追加: Range#size サイズの遅延評価
* 追加: Range#bsearch 二分探索
* RubyVM (MRI specific)
* 追加: RubyVM::InstructionSequence.of to get the instruction sequence
f... -
制御構造 (36.0)
-
制御構造 条件分岐: * if * unless * case 繰り返し: * while * until * for * break * next * redo * retry 例外処理: * raise * begin その他: * return * BEGIN * END
...の式が begin 節である場合にはそれを最初に一回評価してから繰り返します。
//emlist[例][ruby]{
send_request(data)
begin
res = get_response()
end while res == 'Continue'
//}
while 修飾した式は nil を返します。
また、引数を伴った break により w......hile 修飾した式の戻り値を
その値にすることもできます。
====[a:until] until
//emlist[例][ruby]{
until f.eof?
print f.gets
end
//}
文法:
until 式 [do]
...
end
式を評価した値が真になるまで、本体を繰り返して実行......を伴った break により
until 式の戻り値をその値にすることもできます。
==== until修飾子
//emlist[例][ruby]{
print(f.gets) until f.eof?
//}
文法:
式 until 式
右辺の式を評価した値が真になるまで、左辺を繰り返して実行しま
す...