9. Ruby Beyond the Basics l

Overview

By the end of this chapter, you will be able to use blocks to improve code reusability; implement yield with blocks to maintain control over program flows; implement procs and lambdas with blocks and compare procs and lambdas.

This chapter aims to give you a general overview of metaprogramming.

Introduction

In the previous chapters, we learned how to debug Ruby programs using the logger class. In this chapter, we will learn about some of the advanced topics of the Ruby programming language, such as blocks, procs, and lambdas. By now, you must have realized that it's really easy to start writing Ruby code, create sample apps, and get instant gratification; however, every new Ruby developer (and sometimes ...

Get The Ruby Workshop 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.