From: Robert Klemme Date: 2012-03-27T16:35:52+09:00 Subject: Re: include over extend ? Thomas Sawyer wrote in post #1053450: > I have a set of modules that contain methods intended for the class > level. As such, does in make more sense to use straight interface: > > class Foo > extend ModuleInQuestion > > ... > end > > Or, would you say it is better to refactor to use more idiomatic > inclusion, using some form ClassMethods/included callback allowing: > > class Foo > include ModuleInQuestion > > ... > end > > What say you? Use #extend because include will also place methods in the scope of instances which is not what you want. Note: you can make it work with include but IMHO that makes things overly complicated. Kind regards robert -- Posted via http://www.ruby-forum.com/.