Created
December 18, 2015 14:40
-
-
Save lazyatom/6606b777c062ac8e1b84 to your computer and use it in GitHub Desktop.
Do refinements work in JRuby?
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 Refinement | |
refine Object do | |
def new_method | |
'new method!' | |
end | |
end | |
end | |
class Thing | |
using Refinement | |
def test | |
puts Object.new.new_method | |
end | |
end | |
Thing.new.test |
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
NoMethodError: undefined method `new_method' for #<Object:0x7c8740de> | |
test at test.rb:13 | |
<top> at test.rb:18 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment