10. Ruby Beyond the Basics ll

Overview

By the end of this chapter, you will be able to open classes to add/modify methods; implement monkey patching; use methods such as method_missing and define_method to dynamically create methods at runtime; generate HTTP requests using the built-in Ruby HTTP client net/http; create GET and POST requests using Ruby and create your own gems to share your reusable code.

Introduction

In the previous chapter, we learned about a number of advanced topics, including blocks, procs, and lambdas, which we will use in this chapter when we dive deep into the world of metaprogramming. We will also learn when we should not apply metaprogramming concepts by not always crossing the line into monkey patching (which ...

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.