Skip to content

Instantly share code, notes, and snippets.

@pocke
Created May 30, 2018 08:10
Show Gist options
  • Save pocke/1564b1f4cf625f3811f619c379221474 to your computer and use it in GitHub Desktop.
Save pocke/1564b1f4cf625f3811f619c379221474 to your computer and use it in GitHub Desktop.
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