Skip to Content
Effective Ruby: 48 Specific Ways to Write Better Ruby
book

Effective Ruby: 48 Specific Ways to Write Better Ruby

by Peter Jones
September 2014
Intermediate to advanced content levelIntermediate to advanced
240 pages
7h 2m
English
Addison-Wesley Professional
Content preview from Effective Ruby: 48 Specific Ways to Write Better Ruby

2. Classes, Objects, and Modules

Object-oriented programming (OOP) is Ruby’s bread and butter. It’s often referred to as a purely object-oriented language because everything in Ruby is an object or can be turned into one, and I mean everything. From classes all the way down to numeric literals, Ruby exposes a consistent design that is found in few other languages.

Ruby’s object model was heavily influenced by Smalltalk and is probably a bit different than what you’re used to if you’re coming from languages like C++ or Java. The fact that classes are also objects is enough to send your mind into infinite recursion if you let it. Then there are some gotchas like subclasses not automatically initializing their superclasses and the ambiguity between ...

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

The Ruby Way: Solutions and Techniques in Ruby Programming, Third Edition

The Ruby Way: Solutions and Techniques in Ruby Programming, Third Edition

Hal Fulton, André Arko
Ruby Cookbook, 2nd Edition

Ruby Cookbook, 2nd Edition

Lucas Carlson, Leonard Richardson

Publisher Resources

ISBN: 9780133847086Purchase book