るりまサーチ

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

別のキーワード

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

ライブラリ

クラス

モジュール

キーワード

検索結果

<< < ... 6 7 8 >>

Enumerable#cycle(n=nil) {|obj| ... } -> object | nil (119.0)

Enumerable オブジェクトの各要素を n 回 or 無限回(n=nil)繰り返し ブロックを呼びだします。

...//emlist[例][ruby]{
a = ["a", "b", "c"]
a.cycle {|x| puts x } # print, a, b, c, a, b, c,.. forever.
a.cycle(2) {|x| puts x } # print, a, b, c, a, b, c.
//}

ブロックを省略した場合は、n 回 or 無限回 enum の各要素を
繰り返す Enumerator を返します。

@return ブロ...
...ックを指定しなかった場合は、Enumerator を返します。
レシーバが空の場合は nil を返します。...

Array#cycle(n=nil) -> Enumerator (113.0)

配列の全要素を n 回(nilの場合は無限に)繰り返しブロックを呼びだします。

...省略した場合は Enumerator を返します。

@param n 繰り返したい回数を整数で指定します。
整数以外のオブジェクトを指定した場合は to_int メソッドによる暗
黙の型変換を試みます。

@raise TypeError 引数に整数以外...
...の(暗黙の型変換が行えない)オブジェクトを
指定した場合に発生します。

//emlist[例][ruby]{
a = ["a", "b", "c"]
a.cycle {|x| puts x } # print, a, b, c, a, b, c,.. forever.
//}...

Array#reverse_each -> Enumerator (113.0)

各要素に対して逆順にブロックを評価します。

...て逆順にブロックを評価します。

ブロックが与えられなかった場合は、自身と reverse_each から生成した
Enumerator オブジェクトを返します。

//emlist[例][ruby]{
a = [ "a", "b", "c" ]
a.reverse_each {|x| print x, " " }
# => c b a
//}

@see Array#each...

Array#reverse_each {|item| ... } -> self (113.0)

各要素に対して逆順にブロックを評価します。

...て逆順にブロックを評価します。

ブロックが与えられなかった場合は、自身と reverse_each から生成した
Enumerator オブジェクトを返します。

//emlist[例][ruby]{
a = [ "a", "b", "c" ]
a.reverse_each {|x| print x, " " }
# => c b a
//}

@see Array#each...

IO#reopen(path) -> self (113.0)

path で指定されたファイルにストリームを繋ぎ換えます。

...path で指定されたファイルにストリームを繋ぎ換えます。

第二引数を省略したとき self のモードをそのまま引き継ぎます。
IO#pos, IO#lineno などはリセットされます。

@param path パスを表す文字列を指定します。

@param mode パ...
...ist[例][ruby]{
IO.write("testfile", "This is line one\nThis is line two\n")
f1 = File.new("testfile", "a+")
f2 = File.new("testfile")
f1.print("This is line three\n")
f2.readlines # => ["This is line one\n", "This is line two\n"]
f1.close
f2.reopen("testfile", "r") # => #<File:testf...
...ile>
f2.readlines # => ["This is line one\n", "This is line two\n", "This is line three\n"]
f2.close
//}

@see Kernel.#open...

絞り込み条件を変える

IO#reopen(path, mode) -> self (113.0)

path で指定されたファイルにストリームを繋ぎ換えます。

...path で指定されたファイルにストリームを繋ぎ換えます。

第二引数を省略したとき self のモードをそのまま引き継ぎます。
IO#pos, IO#lineno などはリセットされます。

@param path パスを表す文字列を指定します。

@param mode パ...
...ist[例][ruby]{
IO.write("testfile", "This is line one\nThis is line two\n")
f1 = File.new("testfile", "a+")
f2 = File.new("testfile")
f1.print("This is line three\n")
f2.readlines # => ["This is line one\n", "This is line two\n"]
f1.close
f2.reopen("testfile", "r") # => #<File:testf...
...ile>
f2.readlines # => ["This is line one\n", "This is line two\n", "This is line three\n"]
f2.close
//}

@see Kernel.#open...

JSON::Parser#source -> String (113.0)

現在のソースのコピーを返します。

...//emlist[例][ruby]{
require 'json'

parser = JSON::Parser.new(DATA.read)
print
parser.source

# => {
# => "Tanaka": {
# => "name":"tanaka",
# => "age":20
# => },
# => "Suzuki": {
# => "name":"suzuki",
# => "age":25
# => }
# => }

__END__
{
"Tanaka": {
"name":"tanaka",...
<< < ... 6 7 8 >>