1.6. Ruby Jargon and Slang

You don’t have to re-learn English when you learn Ruby. But certain pieces of jargon and slang are commonly used in the community. Some of these may be used in slightly different ways from the rest of the computer science world. Most of these are discussed in this section.

In Ruby, the term attribute is used somewhat unofficially. We can think of an attribute as being an instance variable that is exposed to the outside world via one of the attr family of methods. This is a gray area because we could have methods such as foo and foo= that don’t correspond to @foo as we would expect. And certainly not all instance variables are considered attributes. As always, common sense should guide your usage.

Attributes in Ruby ...

Get The Ruby Way: Solutions and Techniques in Ruby Programming, Second Edition 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.