Back to Developer Roadmap

Procs

src/data/roadmaps/ruby/content/[email protected]

4.01013 B
Original Source

Procs

A Proc in Ruby is an object that represents a block of code that can be stored, passed around, and executed later. Think of it as a named, reusable chunk of code. Unlike regular methods, Procs are objects, allowing them to be treated like any other variable, passed as arguments to methods, and stored in data structures. They capture the surrounding context in which they are defined, meaning they have access to variables and methods available at the time of their creation.

Visit the following resources to learn more: