Sha256: b70bd9fa654cf727a931ba310c2ce42d019c0437f32b620c1a0eb176da38cdf4
Contents?: true
Size: 324 Bytes
Versions: 12
Compression:
Stored size: 324 Bytes
Contents
class Bogus::OverwritesClasses def overwrite(full_name, new_klass) modules = full_name.split('::') klass_name = modules.pop parent_module = modules.reduce(Object) { |mod, name| mod.const_get(name) } parent_module.send(:remove_const, klass_name) parent_module.const_set(klass_name, new_klass) end end
Version data entries
12 entries across 12 versions & 1 rubygems