mirror of
https://github.com/kamranahmedse/developer-roadmap.git
synced 2026-09-24 15:00:31 +08:00
* refactor: clean to roadmap content * refactor: move shared helpers into scripts/lib
993 B
993 B
Attributes Accessors
Attributes accessors provide a convenient way to access and modify the instance variables of a class. They automatically generate methods for reading (getting) and writing (setting) the values of these variables. The three main types are attr_reader, which creates a getter method; attr_writer, which creates a setter method; and attr_accessor, which makes both a getter and a setter method. These accessors simplify code and encapsulate the internal state of objects.
Visit the following resources to learn more: