From: "Brian Schröder" Date: 2005-03-02T22:06:31+09:00 Subject: Re: Modules and methods On Wed, 2 Mar 2005 21:55:02 +0900, ts wrote: > >>>>> "J" == Javier Valencia writes: > > J> private > J> def MyMod.priv_method > J> puts "world" > J> end > > You have written something like this > > private > class << self > def priv_method > puts "world" > end > end > > i.e. private was the default for the module but not for the singleton > class. > aha, that means: #!/usr/bin/ruby -wd module MyMod def MyMod.mymethod puts "hello" priv_method end class << self private def priv_method puts "world" end end end MyMod.mymethod => "Hello World" MyMod.priv_method => Error, private method would be the correct way to define it? regards, Brian -- Brian Schr�der http://ruby.brian-schroeder.de/