* trans.  (T. Onoma) <transami / runbox.com> [2004-09-26 12:10:59 +0900]:

> It's related to AOP. The basic idea is to be able to reroute method 
> invocations.
> 
>    class A
>      def a; puts "here"; end
>    end
>    class B < A
>      def b(meth)
>        puts "before"
>        send(meth)
>        puts "after"
>      end
>      def local_method_missing(sym, *args)
>        if /^a/ =~ meth.to_s
>          b(meth)
>        end
>      end
>    end
 
Could you just use super?

  class A
    def a; puts "in a"; end
  end
  class B < A
    def a
      puts "before"
      super
      puts "after"
    end
  end

  B.new.a

-- 
Jim Freeze