N°19/20


#1

what's the problem please?

class Message
@@messages_envoyes = 0
def initialize(de,a)
@de = de
@a = a
@@messages_envoyes += 1
end
end
mon_message = Message.new("batard","gigi")
class Email < Message
def initialize(sujet)
@sujet = sujet
end
end


#2

for @sujet put anything

class Email < Message
def initialize(sujet)
@sujet = uyfuyfo
end
end


#3
@sujet = uyfuyfo

Why? Our goal is to create an email with the subject we want right? I liked your first Email class better.

Also, if you're going to give a value, you should either use a string or an integer, because the way you're using uyfuyfo will likely trigger an error of the type: "uyfuyfo used but not initialized" or something like that.


#4

Hi,
i get the exact same problem with my code

class Message
    @@messages_envoyes = 0
    def initialize(de,a)
        @de = de
        @a = a
        @@messages_envoyes += 1
    end    
end
class Email < Message
    def initialize(sujet)
        @sujet = sujet
    end
end

any advice please ?


#5

@ironic_man I have the same problem! The code looks right but for some reason the app is throwing an error.

@teraslayer33670, adding you to this thread because it's the same issue that you were having


#6

I was able to get my code to run by closing my browser, navigating back to the same page and running it again. Strange. I don't know why that cleared up the class/superclass error but give it a shot if you are having the same issue!


#7

@stud_on_codecademy This code worked out for me! (Debugging required!) :laughing:

class Message; @@messages_sent = 0; def initialize(from, to); @@messages_sent += 1
@from = from; @to = to; end; end; my_message = Message.new("james", "john")
class Email < Message, def initialize(subject); @subject = subject, end; end


#8

I got "Mismatch error" when i refresh the page it worked:confused:


#9

Refresh the page 'F5' and run the code again


#10

I'm having the same problem and refreshing the page isn't helping


#11

My code it’s work

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

my_message = Message.new(“from”, “to”)

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