Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist
View gist:314358
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
class Author
def invoke_inside(method, *args)
self.send(method, *args)
end
end
 
author = Article.first.author
def author.foobar
"foobar"
end
 
author.object_id # => 9969140
author.respond_to?(:foobar) # => true
author.class # => Author
author.invoke_inside(:object_id) # => 9952490
author.invoke_inside(:respond_to?, :foobar) # => false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.