From: ts Date: 2006-07-05T17:33:45+09:00 Subject: Re: module methods acting like instance methods in extension module >>>>> "J" == John Gabriele writes: J> Am I not understanding correctly how "include" works? Can anyone tell J> me why this works? I tried it with some simple example code (pure J> Ruby): Well try this moulon% cat b.rb #!/usr/bin/ruby module TheModule def self.foo123 puts "Doing stuff..." end private def foo123 puts "I'm the private method doing stuff..." end end include TheModule TheModule.foo123 foo123 self.foo123 # will give an error because it's a private method moulon% moulon% ./b.rb Doing stuff... I'm the private method doing stuff... ./b.rb:17: private method `foo123' called for main:Object (NoMethodError) moulon% module_function define a public singleton method and a private method. Guy Decoux