A
Alexandre Mutel
I tried several way, but didn't found any to override the behavior of
the "include" method.
I would like to override it's behavior to accept a string as an argument
and perform a special include based on that.. so I tried something like
this:
class Module
def include(module1, *smth) # :doc:
puts "In my include #{self}"
if ( module1.is_a? String)
instance_eval(File.read(module1), module1)
else
super module1,*smth
end
end
end
without any success, this method is nether called.
Any ideas?
the "include" method.
I would like to override it's behavior to accept a string as an argument
and perform a special include based on that.. so I tried something like
this:
class Module
def include(module1, *smth) # :doc:
puts "In my include #{self}"
if ( module1.is_a? String)
instance_eval(File.read(module1), module1)
else
super module1,*smth
end
end
end
without any success, this method is nether called.
Any ideas?