Syntax of Ruby Programming Part 2
The difference of Ruby from Python and Perl is the ability to keep all of its instance variables completely private to the class and it can only be exposed by the accessor methods. In Ruby Language, the accessor methods can be written with a single line of code. The use of parentheses is not required. In Python, once a programmer uses publicly exposed instance variable, the implementation can later be to used as a private instance variable exposed through a property descriptor. Ruby programming actually removes this design decision by forcing all instance variables to be private. In a way, Ruby also provides a simple way to declare set and get methods.
