Can't figure out this inheritance


#1


https://www.codecademy.com/courses/ruby-beginner-en-MFiQ6/2/3?curriculum_id=5059f8619189a5000201fbcb#

Can you please tell me what is wrong with my exercise?
It gives the error "superclass mismatch for class Dragon" and I do not know what this means.


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 fight
        return "Breathes fire!"
    end
end

I've also tried this one below, but it throws the same exception.

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 fight
    super
        return "Breathes fire!"
    end
end

#2

Seems that refreshing the page solves the problem.


#3

How do I mark this question as solved?


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.