Name

yield Statement

Synopsis

yield([expr...])
yield [expr...]

Executes the block passed to the method. The expression passed to yield is assigned to the block’s arguments. Parallel assignment is performed when multiple expressions are passed. The output of the block, in other words the result of the last expression in the block, is returned.

Get Ruby in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.