From: ts Date: 2003-11-22T23:56:57+09:00 Subject: Re: Method wrapper question (was "stereotyping (was ...)) >>>>> "G" == Gavin Sinclair writes: G> What difference does it make? Import a method or define it yourself - G> what's the big deal? OK, but I want to do the same with normal methods G> What about: G> require 'example' # Includes class A, which defines A#foo:pre, # and define a private method a G> # but I don't know that, because I just use G> # the library; I didn't write the damn thing. G> # I know about A#foo, though, because it's a G> # really important method I read about in the G> # RDoc. G> # Hmmm.... I just want to log calls to A.foo, because something G> # funny seems to be going on in there. # I just want to define a method a G> class A G> def foo:pre(*args) G> puts "Calling A#foo(#{*args.join(',')})" G> end def a puts "a" end G> end G> So are you saying I shouldn't do that? Or the author of class A G> shouldn't define foo:pre, or that I should write a module defining G> A#foo:pre and include that in A? You have the same problem actually with methods, perhaps you just don't see it Guy Decoux