undef_method And The Inheritance Hierarchy
class Phone
def ring
puts 'brrrrriiing'
end
end
class Smartphone < Phone
def ring
puts 'boop beep boop'
end
end
class Iphone < Smartphone
end
smartphone = Smartphone.new
iphone = Iphone.new
smartphone.ring
#=> boop beep boop
iphone.ring
#=> boop beep boopLast updated