From: Robert Klemme Date: 2013-01-10T16:29:54+09:00 Subject: Re: Extending class On Wed, Jan 9, 2013 at 11:33 PM, Calvin Bornhofen wrote: > Hello, > > I don't know if my tip applies for you (haven't worked with neither Rails > nor Mongoid), but your scenario looks like subclassing is the way to go; you > have a UserForForum class, which is a more specialized form of User. I also believe that is what is called for here. > A way of extending a class like a module doesn't exist in Ruby afaik. Well, it does because you can extend *anything*: irb(main):001:0> module M; def honk; puts "---"; end end => nil irb(main):002:0> o = Object.new => # irb(main):003:0> o.extend M => # irb(main):004:0> o.honk --- => nil Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/