Last active
February 26, 2016 16:07
-
-
Save havenwood/8d9f41483e0baebdec59 to your computer and use it in GitHub Desktop.
Example of refinements working from top level except not in irb/pry (run the file like `ruby abs3.rb` and it works)
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
module Abs3 | |
refine Numeric do | |
def abs3 | |
self ** 3 | |
end | |
end | |
end | |
using Abs3 | |
puts 3.abs3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment