Skip to content

Instantly share code, notes, and snippets.

@jonleighton
Created November 15, 2011 23:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonleighton/1368727 to your computer and use it in GitHub Desktop.
Save jonleighton/1368727 to your computer and use it in GitHub Desktop.
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