Created
September 12, 2011 20:49
-
-
Save ryanbriones/1212364 to your computer and use it in GitHub Desktop.
For noms (https://github.com/sdegutis/omnomnom) greater than 42
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class String | |
def method_missing(*args) | |
if args.first.to_s.match(/omnom/) | |
noms = args.first.to_s.scan(/nom/).length | |
self[0..-(noms+1)] | |
else | |
super | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment