concept Proc in category ruby

appears as: Proc, Proc
The Well-Grounded Rubyist, Third Edition

This is an excerpt from Manning's book The Well-Grounded Rubyist, Third Edition.

In this example, the anonymous function (the Proc object) returns 11 1, so even if there’s no number greater than 10 in the array, you get one anyway. (You’ll see lambdas and Proc objects up close in chapter 14.)

Let’s start with the basic callable object: an instance of Proc, created with Proc.new. You create a Proc object by instantiating the Proc class, including a code block: