Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

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

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!