Ask A Question


You’re not receiving notifications from this thread.

Loops & Blocks in Ruby Discussion

Discussion for Loops & Blocks in Ruby

Hey Collin! Can you give us some examples where you might want to reach for a Proc or a stabby lambda instead of a regular method / function?


Sure thing, I'll work on writing something up soon and/or add a video about this. One thing to think about in the meantime is this: A method (typically) is "bound" to a specific object, causing self to refer to that object when the method is invoked. On the other hand, a Proc lacks this behavior, as self relies on the context in which the Proc was created or called.


Interesting! And awesome, looking forward to it. :)


One of my favs in the series so far! : )

Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 78,890+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more.

    © 2023 GoRails, LLC. All rights reserved.