Object-Oriented Programming I Inheriting a Fortune


#1

What's wrong?

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

superclass mismatch for class Email


#2

I have the exact same problem! Pretty sure that your code is right, can't figure out what the issue is.

@teraslayer33670, did you ever figure out a solution?


#3

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


#4

Try solving the 20th Question and come back and submit th 19th. It is working


#5

I found it worked as soon as i removed the my_message = Message.new and submitted.

I assume this was something i was supposed to either remove or type over on the previous page, but threw me for a loop too.


#6

Refreshing the page worked for me. Thanks!