From: "Jesús Gabriel y Galán" Date: 2011-11-08T01:33:13+09:00 Subject: Re: How to include a function from a different file in a module On Mon, Nov 7, 2011 at 5:29 PM, Andreas L. wrote: > Hi! > > Would it be possible to have a module with one or several of its methods > (source code) stored in a different file? > > Something like this with "func_b" stored in a different file than the > module. > > _________file1.rb_________ > module MyModule >   def func_a >      ... >   end > >   require "file2.rb" > > end > > _________file2.rb_________ > def func_b >   ... > end > > (This gived the error "private method `func_b called for MyModule:Module > (NoMethodError)") In file2.rb you have to place func_b inside the module too: _________file2.rb_________ module MyModule def func_b ... end end Jesus.