Created
July 30, 2015 18:31
-
-
Save Supernats/c37d387cc9c52870f5b8 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| module Refinements::StringNumericalConversions | |
| refine String do | |
| def to_integer | |
| Integer(self) | |
| rescue ArgumentError | |
| nil | |
| end end | |
| refine NilClass do | |
| def to_integer; end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment