Why would you use attr_accessor
in Rails?
Documentation: http://apidock.com/ruby/Module/attr_accessor
My understanding is that it can be used to create "transient" variables that are not persisted in the db. And that it's a substitute for manually writing a setter and a getter.
But I don't think other answer explain much more than above. Ie: Why use Ruby's attr_accessor, attr_reader and attr_writer?
So I'm still not sure in what situation I would actually use it. Can anyone elaborate?