DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

BlankSlate: Clean An Object Class To Its Bare Minimum Methods In Ruby

04.09.2006
| 6866 views |
  • submit to reddit
        From <a href="http://onestepback.org/index.cgi/Tech/Ruby/BlankSlate.rdoc">http://onestepback.org/index.cgi/Tech/Ruby/BlankSlate.rdoc</a>

class BlankSlate
   instance_methods.each { |m| undef_method m unless m =~ /^__/ }
end