Skip to content

Instantly share code, notes, and snippets.

@drbrain
Last active December 26, 2015 14:19
Show Gist options
  • Save drbrain/97fe0a5399c9fa038fae to your computer and use it in GitHub Desktop.
Save drbrain/97fe0a5399c9fa038fae to your computer and use it in GitHub Desktop.
class C
def method
:method
end
def x
end
end
o = Object.new
method_method = o.method(:method).unbind
c = C.new
m = method_method.bind(c).call :x
p m
p c.method
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment