19. Inheriting a fortune, help!


Hello, I am currently having some problems with my code, I dunno what is wrong. It keps saying there is a mismatch in superclass for Email class. Thanks in advance!

Okay, I cannot upload an image, I dunno how its done...here is the code...

class Message 
    @@messages_sent = 0
    def initialize(from, to)
        @from = from
        @to = to
        @@messages_sent +=1

my_message = Message.new("Ana", "Joao")

class  Email < Message
    def initialize(subject)
        @subject = subject


I had the same problem. Here is the solution to it:
1. Cut all the code out.
2. Click to 'Reset the Code"
3. Refresh the page
4. Paste your code back
5. Press 'Run"

Hope that helps! =)


Thanks :slight_smile:

It seems if I put a class variable emal, it also Works.
I didn't know classes were obliged to have a class variable!
THis is done!


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