Skip to content

Instantly share code, notes, and snippets.

@jasiek
Created January 17, 2012 15:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jasiek/1627013 to your computer and use it in GitHub Desktop.
Save jasiek/1627013 to your computer and use it in GitHub Desktop.
module M
def hello
1
end
end
module N
include M
def hello
2 + super
end
end
class C
include N
end
puts C.new.hello # 3
class C
def hello
7 + M.instance_method(:hello).bind(self).call
end
end
puts C.new.hello # 8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment