Please could you send me the code you're using to include your module
in a class? I'll have a better idea then what the problem might be.
Normally I would do something like this:
class MyClass
include MyModule
end
Or even:
MyClass.send :include, MyModule
Have you had a chance to read the section on Modules, pages 7-10? If
not, you might find the answer there.
Regards,
Andy
-------
Andrew Stewart
AirBlade Software Ltd
http://airbladesoftware.com
I think you have found a mistake on page 21, for which I apologise!
The problem is that +include+ is a private method of class Module; and
private methods cannot be called with receivers. The only way to call
+include+ on something other than +self+ is to bypass the private
restriction by sending the :include message like this:
base.send :include, InstanceMethods
You can see this technique on p.23 where the hook code in init.rb is
described:
ActiveRecord::Base.send :include, YourName::PluginName
Regards,
Andy Stewart
-------