Isn't there a ruby construct for doing this?  http://ruby-doc.org/core-2.0/Module.html#method-i-attr_accessor