るりまサーチ

最速Rubyリファレンスマニュアル検索!
192件ヒット [1-100件を表示] (0.048秒)
トップページ > クエリ:b[x] > クエリ:cycle[x]

別のキーワード

  1. string b
  2. _builtin b
  3. b
  4. b string
  5. b _builtin

ライブラリ

クラス

モジュール

キーワード

検索結果

<< 1 2 > >>

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

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

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

n に 0 もしくは負の値を渡した場合は何もしません。
繰り返しが最後まで終了した場合(つまりbreakなどで中断しなかった場合)
は nil...
...度 Enumerable の終端に到達した後に自分自身を変更しても
このメソッドの動作に影響を与えません。

//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.
//}

...

Enumerable#cycle(n=nil) -> Enumerator (21144.0)

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

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

n に 0 もしくは負の値を渡した場合は何もしません。
繰り返しが最後まで終了した場合(つまりbreakなどで中断しなかった場合)
は nil...
...度 Enumerable の終端に到達した後に自分自身を変更しても
このメソッドの動作に影響を与えません。

//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.
//}

...

Array#cycle(n=nil) {|obj| block } -> nil (18226.0)

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

...黙の型変換を試みます。

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

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

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

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

...黙の型変換を試みます。

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

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

void rb_gc_force_recycle(VALUE p) (12200.0)

p を強制的に GC します。

p を強制的に GC します。

絞り込み条件を変える

Object#pretty_print_cycle(pp) -> () (9107.0)

プリティプリント時にオブジェクトの循環参照が検出された場合、 Object#pretty_print の代わりに呼ばれるメソッドです。

...された場合、
Object#pretty_print の代わりに呼ばれるメソッドです。

あるクラスの pp の出力をカスタマイズしたい場合は、
このメソッドも再定義する必要があります。

@param pp PP オブジェクトです。

//emlist[][ruby]{
class Array
d...
...ef pretty_print_cycle(q)
q.text(empty? ? '[]' : '[...]')
end
end
//}

@see Object#pretty_print...

Enumerable#lazy -> Enumerator::Lazy (3018.0)

自身を lazy な Enumerator に変換したものを返します。

...渡さないケースのみlazy)
* cycle (※一貫性のため、ブロックを渡さないケースのみlazy)

以下はピタゴラス数 (a**2 + b**2 = c**2 を満たす自然数 a, b, c の組) を
列挙するプログラムです。

//emlist[例][ruby]{
def pythagorean_triples
(1..Float...

Object#pretty_print(pp) -> () (3006.0)

PP.pp や Kernel.#pp がオブジェクトの内容を出力するときに 呼ばれるメソッドです。PP オブジェクト pp を引数として呼ばれます。

...ブジェクトです。

//emlist[][ruby]{
require 'pp'

class Array
def pretty_print(q)
q.group(1, '[', ']') {
q.seplist(self) {|v|
q.pp v
}
}
end
end
//}

@see Object#pretty_print_cycle, Object#inspect, PrettyPrint#text, PrettyPrint#group, PrettyPrint#breakable...
...@param pp PP オブジェクトです。

//emlist[][ruby]{
class Array
def pretty_print(q)
q.group(1, '[', ']') {
q.seplist(self) {|v|
q.pp v
}
}
end
end
//}

@see Object#pretty_print_cycle, Object#inspect, PrettyPrint#text, PrettyPrint#group, PrettyPrint#breakable...

PP.sharing_detection -> bool (134.0)

共有検出フラグを表すアクセサです。 デフォルトは false です。true である場合、 PP.pp は一度出力したオブジェクトを再び出力する時 Object#pretty_print_cycle を使います。

...pp は一度出力したオブジェクトを再び出力する時
Object#pretty_print_cycle を使います。

@param boolean 共有検出フラグを true か false で指定します。

//emlist[][ruby]{
b
= [1, 2, 3]
a = [b, b]

pp a #=> [[1, 2, 3], [1, 2, 3]]

PP.sharin...
<< 1 2 > >>