Sha256: 2f5b9eecb8438c06cd09f4be17c6220bc46747bcaa45c71627df5e54364eddf4
Contents?: true
Size: 555 Bytes
Versions: 66
Compression:
Stored size: 555 Bytes
Contents
class Module def focus *wanteds wanteds.map! { |m| m.to_s } unwanteds = public_instance_methods(false).grep(/test_/).map(&:to_s) unwanteds -= 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
66 entries across 66 versions & 5 rubygems