るりまサーチ

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

別のキーワード

  1. _builtin to_r
  2. open3 pipeline_r
  3. matrix elements_to_r
  4. fileutils rm_r
  5. fileutils cp_r

ライブラリ

クラス

検索結果

Enumerator#feed(obj) -> nil (21213.0)

Enumerator 内部の yield が返す値を設定します。

...Enumerator 内部の yield が返す値を設定します。

これで値を設定しなかった場合は yield は nil を返します。

この値は内部で yield された時点でクリアされます。

//emlist[例][ruby]{
# (1), (2), ... (10) の順に実行される
o = Object.new
def...
...p x # not reached w/o another e.next
end

e = o.to_enum
e.next # (1)
e.feed "foo" # (3)
e.next # (4)
e.next # (7)
# (10)
//}

@param obj Enumerator 内部の yield が返す値
@raise TypeError すでに値をこのメ...

制御構造 (3130.0)

制御構造 条件分岐: * if * unless * case 繰り返し: * while * until * for * break * next * redo * retry 例外処理: * raise * begin その他: * return * BEGIN * END

...:
* if
* unless
* case
繰り返し:
* while
* until
* for
* break
* next
* redo
* retry
例外処理:
* raise
* begin
その他:
* return
* BEGIN
* END

R
ubyでは(Cなどとは異なり)制御構造は式であって、何らかの値を...
...st[例][ruby]{
print "debug\n" if $DEBUG
//}

文法:

式 if 式

右辺の条件が成立する時に、左辺の式を評価してその結果を返します。
条件が成立しなければ nil を返します。

====[a:unless] unless

//emlist[例][ruby]{
unless baby?
feed
_meat
el...
...呼び出しにおける break, next, redo
をまとめると以下のようになります。

//emlist[][ruby]{
def iter
# (a)
# :
# (b)
yield
# (c)
# :
# (d)
end
iter { redo } # -> (b) へ飛ぶ
iter { next } # -> (c) へ飛ぶ
iter { break } # -> (d) へ飛ぶ
//}

(a) は...