Ruby Ruby Basics Ruby Syntax Method Arguments

Adham Hammoud
Adham Hammoud
738 Points

I couldn't answer this question, can please tell me the solution? What is Say.Say !!

please explain

thanks

def say(seconds) puts "ruby" end

say (4)

Adham Hammoud
Adham Hammoud
738 Points

now am getting this notification : The "say" method needs to accept a parameter. In the "say" method body, you need to pass that parameter as an argument to "puts".

1 Answer

Jacob Proffer
MOD
Jacob Proffer
Treehouse Moderator 24,584 Points

Hey Adham,

I can see the confusion. You're supposed to create a method that's just called say. From a quick glance, it almost looks like it reads as say.say.

def say(seconds)
end

With the method name corrected, you'll want to then pass your seconds parameter as an argument to puts.

def say(seconds)
  puts(seconds)
end

Lastly, you'll need to end your program with a call to the say method with "Ruby" as an argument.

def say(seconds)
  puts(seconds)
end

say("Ruby")

Does that make sense?

Jay McGavren
Jay McGavren
Treehouse Teacher

Ah, yup, I can see how that could be confusing. Re-worded the challenge to be a little clearer. Thanks!