As far as methods go there’s remove_method and undef_method. For
constants theres remove_const. An idea I’ve had was to fork, although
that’s a little heavy handed
eg:
… code …
pid = fork do
require ‘this_will_go_away’
but_so_will_this_var = ThisWillGoAway.new
but_so_will_this_var.do_something
end
Process.wait pid
p but_so_will_this_var # NameError
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.