From: Claus Spitzer Date: 2004-08-30T08:59:06+09:00 Subject: Re: silly question On Mon, 30 Aug 2004 08:29:01 +0900, Ferenc Engard wrote: > Hi all, > > Sorry that I am asking so trivial, maybe it is too late: can I somehow > mix in module functions into a module or a class? I.e., > > module X > def X.foo; puts "foo"; end > end > > module Y > include X # what to write here? > def bar; foo(); end # want to call X.foo > end > > Is it even make sense? You can do it in Ruby, and it makes a lot of sense. Refer to the pickaxe for details http://phrogz.net/ProgrammingRuby/tut_modules.html#mixins > > In fact, I used ncurses library with ruby 1.6.8, and there I could use > Ncurses methods like in the example above. With the new libs I cannot do > that. Maybe in the old library the Ncurses methods were module AND > instance methods...? > > Thanks, > Ferenc > >