Don’t wrap instance variables in attr_reader unless necessary - Code with Jason
18-Feb-2021 1284
I’ve occasionally come across advice to wrap instance variables in attr_reader. There are two supposed benefits of this practice, which I’ll describe shortly. First I’ll provide a piece of example code.
Don’t wrap instance variables in attr_reader unless necessary - Code with Jason #ruby #rubydeveloper #rubyonrails #Don’t #instance #variables #attr_reader #unless #necessary #Jason #code https://rubyonrails.ba/link/don-t-wrap-instance-variables-in-attr_reader-unless-necessary-code-with-jason