From: "Jon A. Lambert" Date: 2005-08-30T06:10:19+09:00 Subject: Re: Adding instance methods to class at runtime David A. Black wrote: > or you can use send: > > Foo.send("include", Bar) > Excellent Thank you. I think my problem was scope then. Here's what I be doing and it now works like a charm. $ cat cmd1/cmd_bar.rb module Command def cmd_bar puts "cmd_bar one called" end end $ cat cmd2/cmd_bar.rb module Command def cmd_bar puts "cmd_bar two called" end end $ cat testcmds.rb class Foo end def load1 cmds = Dir.glob("cmd1/cmd_*.rb") cmds.each {|c| load(c)} Foo.send(:include,Command) end def load2 cmds = Dir.glob("cmd2/cmd_*.rb") cmds.each {|c| load(c)} Foo.send(:include,Command) end f = Foo.new load1 f.cmd_bar load2 f.cmd_bar $ ruby testcmds.rb cmd_bar one called cmd_bar two called -- J. Lambert