Fork me on GitHub

Drew's World

Rants, News, Etc on my Life and Projects

Ruby Class vs. Instance Diagram

by Andrew De Ponte (@cyphactor)

One of the many things that I have changed on my new team is the language. They were originally all PHP developers and my boss and I who have been using Ruby and Rails for years now decided to develop the new products in Ruby and Rails where fitting. Anyways, as a part of the process I have been educating (and being educated) by my engineers on Ruby and Rails as they go through the learning process. One of the topics that seems to have some confusion around it is Class vs. Instance variables with respect to classes and objects. Because this confusion I spent some time with one of the engineers to put together a quick diagram to try and help clarify what is actually happening with respect to Class vs. Instance variables and methods. You can find the diagram here.