Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
class Foo
def self.bar
end
def bar
end
end
set_trace_func proc { |event, file, line, id, binding, classname|
if event == "call"
p eval("self", binding) == classname
end
}
foo = Foo.new
Foo.bar
foo.bar
# => true
# => false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.