1. Computing
Michael Morin

New to Ruby 2.0: Refinements

By November 20, 2012

Follow me on:

Feel free to patch monkeys to your heart's content, because as of Ruby 2.0 it can be done in a safe manner. Refinements are a way to implement monkeypatches in a sort of module that can be activated in scopes where the behavior is intended, but leaves all other scopes unchanged. Monkeypatching has always been a risky prospect, controversial and, to some, considered a hack or too risky to do. But with this new feature, it's a perfectly sane and reasonable thing to do.

No comments yet. Leave a Comment
Leave a Comment

Line and paragraph breaks are automatic. Some HTML allowed: <a href="" title="">, <b>, <i>, <strike>

©2014 About.com. All rights reserved.