From: James Coglan Date: 2009-05-26T00:45:50+09:00 Subject: Re: Class methods in a module? --001636c5b1fa04c790046abe81f1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 2009/5/25 Max Williams > At Scotland On Rails a few months ago, I was shown a nice way to put > class methods in a module, alongside instance methods, in such a way as > they will get added as class methods automatically, without any work > required on the part of the person including the module. > > Unfortunately i failed to make a note of how to do this and i've since > forgotten. Can anyone show me? > > I'm not sure if you can pick up the singleton methods from the module and automatically copy them to the class -- I've got type errors before when trying to move and rebind methods. I did come up with this, though, which is more expressive than writing an included() hook on every module: http://gist.github.com/114042 --001636c5b1fa04c790046abe81f1--