Sha256: 07dd9723aaf6c2c1e57c30e2072445d5a3b7fe73621db6350ecd3111ad5b3ef2
Contents?: true
Size: 528 Bytes
Versions: 14
Compression:
Stored size: 528 Bytes
Contents
class Module def focus *wanteds wanteds.map! { |m| m.to_s } unwanteds = public_instance_methods(false).grep(/test_/) - wanteds unwanteds.each do |unwanted| remove_method unwanted end end def focus_re regexp focus(*public_instance_methods.grep(regexp)) end def blur parent = self.superclass ObjectSpace.each_object Class do |klass| next unless parent > klass next if klass == self klass.send :focus klass.send :undef_method, :default_test end end end
Version data entries
14 entries across 14 versions & 4 rubygems