Skip to Content
Polished Ruby Programming
book

Polished Ruby Programming

by Jeremy Evans
July 2021
Intermediate to advanced
434 pages
8h 36m
English
Packt Publishing
Content preview from Polished Ruby Programming

Chapter 2: Designing Useful Custom Classes

In the previous chapter, you learned about how to get the most out of Ruby's core classes. However, outside of small scripts, you'll probably want to create your own classes to organize your code. How you design and structure your classes has a huge effect on how intuitive and maintainable your code is. This chapter will help you learn when a new class is a good idea, how to apply some important object-oriented design principles, how to determine class size, and whether it is worthwhile to introduce a custom data structure.

In this chapter, you'll learn the following principles for designing custom classes:

  • Learning when to create a custom class
  • Handling trade-offs in SOLID design
  • Deciding on larger ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Programming Ruby 3.3

Programming Ruby 3.3

Noel Rappin, Dave Thomas
The Ruby Programming Language

The Ruby Programming Language

David Flanagan, Yukihiro Matsumoto

Publisher Resources

ISBN: 9781801072724Supplemental Content