-
Notifications
You must be signed in to change notification settings - Fork 0
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Making this work on a passable instance of a binding? #2
Comments
@markburns - Thanks! Succinct code is always nice. For your above scenario, there's a bit of jumping around to figure it out. What method do you want to call and what result to you expect to see? |
Sorry it's not a simple concept to explain. Or rather my explanation isn't very good. |
Hey, just going through my open issues and came back to this. require "bindings"
def container_method
called_method(determine_binding)
end
def called_method(other_binding)
other_binding.of_caller(0).eval("__method__")
end
def determine_binding
binding
end
puts container_method()
#=> called_method
# expected
#=> determine_binding |
Hi, I like how concise this gem is. Just found it by looking at binding_of_caller.
One thing that doesn't work with
binding_of_caller
is:The output is
container_method
and notdetermine_binding
.I.e. the
#of_caller
method only acts like the currentbinding
and not on the actual passed instance of thebinding
.I'm thinking of opening an issue there, but it looks a bit unattended. So I imagine I might have to get my hands dirty.
And if I am going to do that, then maybe it's easier to start with your gem instead.
I've not really looked into the debug inspector side of things at all, so it could be that it's just not achievable.
Do you know off the top of your head if that is possible or not?
The text was updated successfully, but these errors were encountered: