RFS: Attr Reader, Writer and Accessor [free video]
In ruby a lot can be achieved in a single line of code. Defining our own getters and setters is usually done when we need custom behavior for all other cases there is already something built in ruby. We’ll cover attr_reader, attr_writer and attr_accessor in this post.
Post a comment