Skip to content

Instantly share code, notes, and snippets.

@enebo enebo/gist:1023643
Created Jun 13, 2011

Embed
What would you like to do?
super in defined_method
class Base
def foo
puts "Base foo"
end
def bar
puts "Base bar"
end
end
class Derived < Base
def bar
self.class.send(:define_method, :foo) do
proc { super() }
end
end
end
d = Derived.new
code = d.bar
d.foo.call
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.