i think this topic will help you.
http://www.rubycentral.com/pickaxe/tut_modules.html
Section : Mixins
Sijo Kg wrote:
i think this topic will help you.
http://www.rubycentral.com/pickaxe/tut_modules.html
Section : Mixins
Sijo Kg wrote:
and see following codes:
module MyTools
def run(*args)
puts "let #{args.join(' ')} run"
end
end
class TryTools
#include MyTools
def initialize()
self.class.send :include,MyTools
end
end
c=TryTools.new
c.run("me")
Roscus Farmer wrote:
Hi
Thanks for the reply
Sijo