Created
May 30, 2018 08:10
-
-
Save pocke/1564b1f4cf625f3811f619c379221474 to your computer and use it in GitHub Desktop.
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
def is_nil?(value) | |
result = true | |
value&.__id__(result = false) | |
result | |
rescue | |
result | |
end | |
TracePoint.new(:line) do |tp| | |
p tp | |
tp.binding.local_variable_set :result, false if tp.lineno == 4 | |
end.enable | |
p is_nil? nil |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment