Hi,
How is it possible to remove modules from memory
In some files I have something like:
module MyModule
module A
end
end
and in some point I want to delete that module to be not available in
other files
Hi,
How is it possible to remove modules from memory
In some files I have something like:
module MyModule
module A
end
end
and in some point I want to delete that module to be not available in
other files
Hi,
You can use the (private) method Module#remove_const. However, this will
not delete the actual module but only the specific constant.
This is exactly what I wanted
Thanks!!
Object.send(:remove_const, :MyModule)
On May 22, 2012, at 05:26 , Mario R. wrote:
How is it possible to remove modules from memory
In some files I have something like:module MyModule
module A
end
end
and in some point I want to delete that module to be not available in
other files
Why? That seems like a design smell to me.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs