From: Dave Thomas Date: 2000-07-06T10:19:48-05:00 Subject: [ruby-talk:03876] Re: main.method ts writes: > >>>>> "D" == Dave Thomas writes: > > D> A second problem is that methods defined at the top-level are private, > D> so they cannot be called with a receiver, so you can't go messing with > ^^^^^^^^^^^^^^^^^^^^^ > [...] > >> # public :globalBurp > ^ > | > [...] > D> Or am I missing something? > > You don't need to add the line : > > public :globalBurp Actually, it doesn't - there's a call from the class that fails without this. That's part of what I was trying to illustrate: class Fish def initialize @burp = "burp" end def burp(global) puts global.globalBurp # <<<<<<<<<<<<< end end @burp = "blop" def globalBurp p self @burp end public :globalBurp puts globalBurp, "\n" puts "now I expect fish to (blobal) burp, which means 'blop'" Fish.new.burp(self) Regards Dave