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

My say method is invalid?

When i attempt to pass my parameters as an argument, it says 'Your "say" method should take exactly 1 parameter.'

say.rb
def say(first)
  first
end
say

1 Answer

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there, Isaiah Narraway! There are a couple of things going on here. In the body of the method, it should be using puts to display whatever was sent in. To call a method, you need a pair of parentheses that will then pass in any arguments needed. In this case, the argument is meant to be the string "Ruby" per the instructions. You're pretty close here, though.

def say(first)
  puts first  # print whatever was sent in
end

say("Ruby") # call the method and send it the string "Ruby"

Hope this helps! :sparkles: