class A end class B < A end module M refine(A) { def abc puts "abc in A" end } refine(B) { def abc super puts "abc in B" end } end using M B.new.abc