るりまサーチ

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

別のキーワード

  1. fiddle ruby_free
  2. rbconfig ruby
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

ライブラリ

クラス

キーワード

検索結果

Dir#rewind -> self (18226.0)

ディレクトリストリームの読み込み位置を先頭に移動させます。

...レクトリストリームの読み込み位置を先頭に移動させます。

@raise IOError 既に自身が close している場合に発生します。

//emlist[例][ruby]{
Dir.open("testdir") do |d|
d.read # => "."
d.rewind # => #<Dir:0x401b3fb0>
d.read # => "."
end
//}...

Enumerator#next -> object (243.0)

「次」のオブジェクトを返します。

...へ到達しているとき
@see Enumerator#rewind

//emlist[例1][ruby]{
str = "xyz"
enum = str.each_byte

str.bytesize.times do
puts enum.next
end
# => 120
# 121
# 122
//}

//emlist[例2][ruby]{
str = "xyz"
enum = str.each_byte

b
egin
puts enum.next while true
rescue StopIter...
...121
# 122
# iteration reached at end
puts enum.next
#=> 再度 StopIteration 例外が発生
//}

//emlist[例3: Kernel.#loop は StopIteration を捕捉します。][ruby]{
str = "xyz"
enum = str.each_byte
loop do
puts enum.next
end
# => 120
# 121
# 122
//}...

CSV#field_size_limit -> Integer (131.0)

フィールドサイズの最大値を返します。

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

csv = CSV.new(DATA)
csv.field_size_limit # => nil
p csv.read # => [["a", "b"], ["\n2\n2\n", ""]]

DATA.rewind
csv = CSV.new(DATA, field_size_limit: 4)
p csv.field_size_limit # => 4
csv.read # => #<CSV::MalformedCSVError: Field size exceeded on line 2.>

__END__
"a","b"
"
2...