method
feed
v1_9_2_180 -
Show latest stable
-
0 notes -
Class: Enumerator
- 1_8_6_287
- 1_8_7_72
- 1_8_7_330
- 1_9_1_378
- 1_9_2_180 (0)
- 1_9_3_125 (11)
- 1_9_3_392 (0)
- 2_1_10 (38)
- 2_2_9 (0)
- 2_4_6 (0)
- 2_5_5 (0)
- 2_6_3 (0)
- What's this?
feed(p1)
public
Set the value for the next yield in the enumerator returns.
If the value is not set, the yield returns nil.
This value is cleared after used.
o = Object.new def o.each # (2) x = yield p x #=> "foo" # (5) x = yield p x #=> nil # (7) x = yield # not reached p x end e = o.to_enum # (1) e.next # (3) e.feed "foo" # (4) e.next # (6) e.next # (8)