I’m trying to extend AR with a method which needs to be available to
both the class and the instance.
I’ve tried a gajillion permutations based on examples. I can get the
method added to the Class, but not to instances.
This seems like a logical pattern to me, but it’s apparently incorect.
module SpiffyMethods
module MyMethods
def shared_method
return “Hello?”
end
end
def self.included(base)
base.extend ClassMethods # works
base.include InstanceMethods # fails
end
module ClassMethods
include MyMethods
end
module InstanceMethods
include MyMethods
end
end
Need a point in the right direction. Thx.
– gw