#19 Syntax Error, need some help


19 Inheriting a Fortune

Hi everybody,

I'm really stuck in this exercise, I tried refresh / forced refresh and no luck.

Are there any mistake in my code or is codecademy broken?

Error message:

(ruby):14: syntax error, unexpected keyword_end, expecting $end

My code:

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

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

my_message = Message.new("Me", "Dad")


Is Email expected to be another class inheiting from Message?


Yes, here's the instruction:
"Create a second class, Email, that inherits from Message. Give it its own initialize method that takes just one parameter, subject, and has one instance variable, @subject, set equal to subject."

Am I doing anything wrong?


You're not creating the class.


Got it, I missed the "class"! Thanks a lot :slight_smile:

class Email < Message