From: "R. Kumar" Date: 2010-03-12T13:59:14+09:00 Subject: Re: Dynamically require and include code in application Brian Candler wrote: > include Object.const_get("Foo") # include ::Foo > > Then maybe you want 'extend' rather than 'include'. 'extend' adds > instance methods from a module to a single object. > > # with module Foo defined as above > > a = "hello" > a.extend Foo > a.say_hello # says hello > > HTH, > > Brian. Just what i wanted, Brian. Now its just an instance method: def load_module requirename, includename require "mylib/#{requirename}" extend Object.const_get("#{includename}") send("#{requirename}_init") end I guess i could just lowercase the includename and have param. Thanks a million. -- Posted via http://www.ruby-forum.com/.