Created
November 15, 2011 23:24
-
-
Save jonleighton/1368727 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class A | |
def foo | |
"lol" | |
end | |
end | |
class B < A | |
def self.add_foo | |
define_method :foo do | |
super | |
end | |
end | |
end | |
B.add_foo | |
p B.new.foo | |
# $ ruby test.rb | |
# test.rb:10:in `block in add_foo': implicit argument passing of super from method defined by define_method() is not supported. Specify all arguments explicitly. (RuntimeError) | |
# from test.rb:16:in `<main>' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment