Skip to content

Instantly share code, notes, and snippets.

@al2o3cr al2o3cr/gist:221585
Created Oct 29, 2009

Embed
What would you like to do?
module Outer
module M
def foo
if self.class.superclass.instance_methods.include?('foo')
super
else
puts 'module foo'
end
end
end
end
class A
def foo
puts 'Overridden foo'
end
end
class B < A
include Outer::M
end
# this works
B.new.foo
# this blows up with a 'superclass not found' error
foo_method = B.new.method('foo')
foo_method.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.