Docfix: Use public interface instead of setting instance variables

Dynamically setting instance variables based on user input probably isn't a great idea. Better to go through the setter methods provided by attr_accessor.
Merge pull request #10874 from rlivsey/patch-1

Docfix: Use public interface instead of setting instance variables