Prohibiting overloading of a method

Replying to my own question, I think I got it:

abstract class A
  macro inherited
    macro method_added(method)
      \{% if method.name == "one" %}
         \{% puts method.name %}
         \{% raise %Q(Don't override method "A#one", use X and Y instead.) %}
      \{% end %}
    end
  end


  def one
    1
  end
end

class B < A
  def one
    2
  end
end

2 Likes