F
Ferenc Engard
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?
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
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?
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