Blocks and Iterators (Part 2)

Anytime the “yield” statement is called upon it calls on the chunk of code within the block executing it returning control to where the yield statement was called continuing on its way till the process is finished. That’s where the magic of Ruby is, that a block can be made to function like a method in itself. This allows processes to embedded and used again and again with minimal coding required to achieve the desired result. The Following post would have blocks used as transactional controllers which use them to do a process that is similar somewhat to the way methods work when they are called upon.

This entry was posted in Development, Programming Basics, Programming Language and tagged , . Bookmark the permalink. Comments are closed, but you can leave a trackback: Trackback URL.