In Ruby there are four different getter and setter methods for instance variables, attr, attr_reader, attr_writer, and attr_acce
attr
attr_reader
attr_writer
attr_acce
In Ruby 1.8, attr can define only a single attribute, with an optional true to create a setter . In 1.9 it behaves like attr_reader:it allows for multiple attributes. As @Linuxios says, the optional boolean is deprecated.
true