Looks like when you include module Foo, the definition of foo in the 
class still takes precedence over the one in the newly-included module.

This seems to work though:

class A
  def foo
    puts 'bar'
  end
end

module Foo
  def self.included(base)
    base.class_eval do
      alias_method :old_foo, :foo
      def foo
        puts 'foobar'
        old_foo
      end
    end
  end
end

A.send :include, Foo

a = A.new
a.foo

-- 
Posted via http://www.ruby-forum.com/.