What is attr_accessor in Ruby?
Let’s say you have a class Person. Obviously we never defined method name. Let’s do that. Aha, we can read the name, but that doesn’t mean we can assign the name. Those are two different methods. The former is called reader and latter is called writer. We didn’t create the writer yet so let’s do that. Awesome. Now we can … Read more