M
Mike Austin
I noticed that if you 'include' a module within a method, it will polute the
namesapce that defines that method. I found a simple solution is to declare a
throw-away class, and execute my code in that. Is there a more better way to
achieve this?
# Pollutes current namespace
def init()
include Inertia
do_stuff_with_inertia()
end
# Doesn't polute namespace, but ugly
class DontPolute
include Inertia
do_stuff_with_inertia()
end
Mike
namesapce that defines that method. I found a simple solution is to declare a
throw-away class, and execute my code in that. Is there a more better way to
achieve this?
# Pollutes current namespace
def init()
include Inertia
do_stuff_with_inertia()
end
# Doesn't polute namespace, but ugly
class DontPolute
include Inertia
do_stuff_with_inertia()
end
Mike