Created
July 31, 2018 12:02
-
-
Save ujihisa/00de41babf4f536263037b3910381c72 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
require 'sin_refinements' | |
module Ext | |
refine Integer do | |
def asdjflk | |
"ujihisa #{self}" | |
end | |
end | |
end | |
class C | |
def x | |
123 | |
end | |
def f | |
x = 234 | |
p x() #=> 123 | |
SinRefinements.refining(Ext) do | |
p x().asdjflk #=> "ujihisa 234" | |
p binding.local_variable_get(:x).asdjflk #=> "ujihisa 234" | |
end | |
end | |
end | |
puts '----------------------' | |
C.new.f |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment