るりまサーチ

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

別のキーワード

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

ライブラリ

クラス

モジュール

キーワード

検索結果

<< 1 2 > >>

Enumerable#cycle(n=nil) {|obj| ... } -> object | nil (24420.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.
//}

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

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

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

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

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

Enumerable#cycle(n=nil) -> Enumerator (24320.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.
//}

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

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

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

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

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

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

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

...ject#pretty_print の代わりに呼ばれるメソッドです。

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

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

//emlist[][ruby]{
class Array
def pretty_print_cycle...
...(q)
q.text(empty? ? '[]' : '[...]')
e
nd
e
nd
//}

@see Object#pretty_print...

絞り込み条件を変える

Enumerator::Lazy#take_while -> Enumerator::Lazy (12248.0)

Enumerable#take_while と同じですが、配列ではなくEnumerator::Lazy を返します。

...
E
numerable#take_while と同じですが、配列ではなくEnumerator::Lazy を返します。

//emlist[例][ruby]{
1.step.lazy.zip(('a'..'z').cycle).take_while { |e| e.first < 100_000 }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:zip(#<Enumerator: "a"...
....."z":cycle>)>:take_while>

1.step.lazy.zip(('a'..'z').cycle).take_while { |e| e.first < 100_000 }.force.last(5)
# => [[99995, "y"], [99996, "z"], [99997, "a"], [99998, "b"], [99999, "c"]]
//}

@see Enumerable#take_while...

Enumerator::Lazy#take_while {|item| ... } -> Enumerator::Lazy (12248.0)

Enumerable#take_while と同じですが、配列ではなくEnumerator::Lazy を返します。

...
E
numerable#take_while と同じですが、配列ではなくEnumerator::Lazy を返します。

//emlist[例][ruby]{
1.step.lazy.zip(('a'..'z').cycle).take_while { |e| e.first < 100_000 }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:zip(#<Enumerator: "a"...
....."z":cycle>)>:take_while>

1.step.lazy.zip(('a'..'z').cycle).take_while { |e| e.first < 100_000 }.force.last(5)
# => [[99995, "y"], [99996, "z"], [99997, "a"], [99998, "b"], [99999, "c"]]
//}

@see Enumerable#take_while...

PP.sharing_detection -> bool (12222.0)

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

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

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

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

b = [1, 2, 3]
a...
...= [b, b]

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

PP.sharing_detection = true
pp a #=> [[1, 2, 3], [...]]
//}...
...
デフォルトは false です。true である場合、
PP.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.sharing_detection = true
pp a #=> [[1, 2, 3], [...]]
//}...

PP.sharing_detection=(boolean) (12222.0)

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

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

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

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

b = [1, 2, 3]
a...
...= [b, b]

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

PP.sharing_detection = true
pp a #=> [[1, 2, 3], [...]]
//}...
...
デフォルトは false です。true である場合、
PP.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.sharing_detection = true
pp a #=> [[1, 2, 3], [...]]
//}...

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

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

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

あるクラスの pp の出力をカスタマイズしたい場合は、このメソッドを再定義します。
そのとき pretty_pri...
...retty_print メソッドを定義しています。

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

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

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

@see Object#pretty_print_cycle, Object#in...
...spect, PrettyPrint#text, PrettyPrint#group, PrettyPrint#breakable...

絞り込み条件を変える

<< 1 2 > >>