Prefer getter methods over instance variables inside Ruby objects
I prefer to use getter methods instead of instance variables inside Ruby classes. I will compare getters to instance variables, focusing mainly on attr_reader.
Note: The code in this article was tested on Ruby 3.4.1
Defining getters to access instanc...
allaboutcoding.ghinda.com9 min read