Making Ruby Methods Immutable

Courtesy Ruby Inside  Wed, 09/24/2008 - 15:48

puzzle_lock.jpgGarry Dolley has developed a Ruby module called "Immutable" (Github repository ).

It allows you to make your methods immutable. As Gary says, "provide it a list of methods you don’t want touched and it’ll make sure they can’t be redefined." Effectively, it's a smack-down against monkeypatching.

Gary developed immutable to ensure that ActiveSupport wouldn't interfere with his attempts to improve Rails' loading time by reimplementing some ActiveSupport methods in C (by redefining his own changes)....


 

More related items

Student Bay Admin Prosecuted in Sweden
After a process lasting more than three years, a man from Sweden has finally been prosecuted for his role in the operations of Student Bay, a site dedicated to the sharing of textbooks....

Kevin Schroeder's Blog: fatal: The remote end hung up...
Kevin Schroeder has a quick tip for anyone using phpcloud.com and having trouble with git and "remote end hung up" error messages. If you are using phpcloud.com and are experiencing errors...

Wojciech Sznapka's Blog: Why Mockery is better than...
Wojciech Sznapka has a new post today sharing his opinions as to why Mockery is better than PHPUnit Mock Builder in testing Symfony2-based applications. Recently I did a lot of Test Driven...


 

Post new comment

The content of this field is kept private and will not be shown publicly.
computer-internet.marc8.com