Undefined description does anyone get that?


#1


https://www.codecademy.com/en/courses/ruby-beginner-en-MFiQ6/3/4?curriculum_id=5059f8619189a5000201fbcb

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

end

def description
    case @from
    when "Alphonse","alphonse" then puts "Thank you for caring clauds"
else
    puts "idk"
end

end
end

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

my_message = Message.new("Alphonse","clauds")
my_message.desciption

its saying undefined method.


Replace this line with your code.


#2

You have defined method called description, but later in the code you try to execute method called desciption:

my_message.desciption

Do you see a problem?

description
desciption

#3

Thank you!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


#4

You're very welcome :slight_smile:


#5

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