What do the attr_reader, attr_writer and attr_accessor messages do?

Just like in C#, in Ruby the access to the variables is set by setters and getters as oppose to methods getVar() and setVar(xx). These are usually defined like so:

This will simply return instance of the object "name" i.e. a getter. Let's have a look at the example. In Ruby we have...