From: Daniel Harple Date: 2006-06-13T11:53:58+09:00 Subject: Re: How to invoke a run method??? On Jun 13, 2006, at 4:37 AM, Eric Armstrong wrote: > I construed that post to mean that this work: > > module Foo > class Main > def run > puts "Running" > end > end > end > Foo::Main.run() if __FILE__ == $0 > > But the result was: > undefined method `run' for Foo::Main:Class #run is an instance method. You could make it a class method: module Foo class Main def self.run puts "Running" end end end Foo::Main.run if __FILE__ == $PROGRAM_NAME Or instigate an object of class Foo::Main: Foo::Main.new.run if __FILE__ == $PROGRAM_NAME -- Daniel