5. Object-Oriented programming with Ruby

Overview

By the end of this chapter you will be able to describe the basics of object-oriented programming using Ruby; model data with classes; implement instance and class variables in Ruby programs; write instance and class methods in application programs; and evaluate getters and setters in Ruby.

Introduction

In the previous chapter, we studied different methods and parameters of Ruby. We also learned about the built-in libraries of Math and Time in Ruby. It was here that we began to introduce the concepts of classes and modules. In this chapter, we will dive deeper into Ruby classes using object-oriented programming (OOP) concepts as our guide.

OOP is where the rubber meets the road in programming. ...

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.