Files
developer-roadmap/roadmaps/ruby/content/attributes-accessors@I9dIFxsUrysgrcqUSBNsW.md
T
Arik Chakma 274082fd77 feat: clean roadmap content and sync scripts (#10181)
* refactor: clean to roadmap content

* refactor: move shared helpers into scripts/lib
2026-07-28 05:45:17 +06:00

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: