Yes
module Foo def self.included(base) base.extend(ClassMethods) end module ClassMethods def some_method
One of the possible comments that I should add: if the module will be used by all methods of the class, it is better to use only extend ModuleName in the model and define methods directly in the module instead, instead of having the ClassMethods module inside the module, a la
module ModuleName def foo
Omar Qureshi Jan 15 '11 at 11:41 2011-01-15 11:41
source share