Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist
View test.rb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
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
Something went wrong with that request. Please try again.