Thanks for the nice recap. In the last example, what is the point of keeping :age in attr_accessor if it's already in attr_reader and that there is a manually defined setter for it?
Ah, nice catch! We indeed do NOT need attr_accessor :age in the last example. I must have left it over as I copied over the code from a few examples ago.
Thank you for pointing it out, updated!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Thanks for the nice recap. In the last example, what is the point of keeping
:age
inattr_accessor
if it's already inattr_reader
and that there is a manually defined setter for it?Ah, nice catch! We indeed do NOT need
attr_accessor :age
in the last example. I must have left it over as I copied over the code from a few examples ago.Thank you for pointing it out, updated!