getter setter « Class « Ruby






1.Add a method named get_color, which returns the color of animal objects created from this class:
2.Call a member method
3.getter and setter
4.Accessors
5.Define getter for a attribute
6.Make an attribute readable and writable by using attr_reader, attr_writer
7.Provide the getter
8.Setter with calculation
9.Setter with =