18/20 Forge an object error [Solved]


#1



I can't understand WHY it get's me an error!!!! a so simple one! I'm completly stuck, I don't know what I have done wrong, I have been starring at the code for hours and i can't find a single mistake, no syntax no forgotten words...NOTHING!!!
please help me....

18. Forge an Object in the Fires of Mount Ruby

Oops, try again. Did you create a variable called my_message?


'

class Message
@@messages_sent = 0
my_message = Message.new("Klaus", "Elijah")
def initialize(from, to)
@from = from
@to = to
@@messages_sent += 1
end

end

`


#2

I originally posted incorrect information. I believe the following is correct:

here's your class:
class Message
@@messages_sent = 0

and your method:
def initialize( )
@(enter your parameters)
@(enter your parameters)
@@messages_sent += 1
end
end

NOW initiate your new variable:

my_message = ( enter in the number of arguments that match the class here )

so close! you almost got it!


#3

ohh, thank you very much!!!! I finally understood it =)

thanks for the quick answer


#4

Of course! Glad you get it:)


#5

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