This metaprogramming seems a little OTT.  Would it not be simpler to just use an [OpenStruct](http://apidock.com/ruby/OpenStruct)?