On 2005-07-26 21:48:34 +0900, Jim Freeze wrote:
> I'm a little slow in getting around to these types of things, I'm
> surprised I haven't seen an RCR to reduce this to a single line.

You can use Ruby to do most of the work:

module Mod
  def f; :"new-f"; end
  def self.included(o)
    instance_methods(false).each do |m|
      o.instance_eval do
        alias_method("_orig_#{m}", m)
        remove_method(m)
      end
    end
    super
  end
end

class A
  def f; :f; end
end

A.new.f # => :f

class A
  include Mod
end

A.new._orig_f # => :f
A.new.f # => :"new-f"

-- 
Florian Frank