I am attempting to finish the Override! problem. I don’t see anything wrong with the code, but when I save and submit it, I get the error message “Oops, try again. It looks like your Dragon’s fight method returns ‘Punch to the chops!’ instead of ‘Breathes fire!’” I’ve refreshed the page several times and still get the same error message. Any help as to why this is happening and how to correct it would be greatly appreciated.
class Creature
def initialize(name) @name = name
end
def fight
return “Punch to the chops!”
end
end
Add your code below!
class Dragon < Creature
def fignt
return “Breathes fire!”
end
I don’t know if i’m right because I’m quite new to this, but, i think it returns nil because you are not calling the class anywhere, therefore the program don’t have anything to show so it shows you a nil.
Try calling fight method of both classes and it should show you how Dragon overrides the Creature one