there are other ways to define class in ruby, for instance this http://johnragan.wordpress.com/2010/02/18/ruby-metaprogramming-dynamically-defining-classes-and-methods/ but you need to investigate this topic and figure out the best way of doing it which fit your needs the best.