Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
class Parent
def foo
puts "I'm a good parent."
end
end
module Interloper
def foo
puts "I've got candy in the van."
end
end
module NiceInterloper
include Interloper
undef foo
end
class FirstChild < Parent
include Interloper
end
class SecondChild < Parent
include NiceInterloper
end
FirstChild.new.foo # => "I've got candy in the van."
SecondChild.new.foo # => "I'm a good parent."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment