From: Avi Bryant Date: 2001-03-06T01:40:48+09:00 Subject: [ruby-talk:12040] Re: ANN: Memoize 0.1.2 On Tue, 6 Mar 2001, ts wrote: > How do you do with such a function ? > > class Foo > def bar > puts "hello world" > yield 12 if block_given? > end > end > > With your example Foo.advice() it give an error message in this case. Really? What error? It works for me: require 'advice' class Foo def bar puts "hello world" yield 12 if block_given? end def Foo.advice(*args) puts "pre" yield end advise_method :bar end Foo.new.bar {|x| puts x} #outputs: # pre # hello world # 12