alias_method, what would you expect? 21 Sep 2007
What would you expect would happen with the following code?

class A
  def a ; puts 'a' ; end
end

class B < A
  def a_with_b ; puts 'b'; a_without_b ; end
  alias_method_chain :a, :b
end

class A
  def a_with_c ; puts 'c'; a_without_c ; end
  alias_method_chain :a, :c
end

A.new.a
B.new.a

Now run it.

Let me know if it meets your expectations.


blog comments powered by Disqus