Skip to content

Instantly share code, notes, and snippets.

@samwgoldman
Created September 13, 2013 23:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samwgoldman/6557156 to your computer and use it in GitHub Desktop.
Save samwgoldman/6557156 to your computer and use it in GitHub Desktop.
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