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 trialIan Dunn
1,178 Pointsdef say(text) puts text+"Ruby" end say("Hello...") Not sure what I am doing wrong? It works in the console?
It's saying I need a parameter? isnt that what text is fulfilling?
def say(text)
puts text+"Ruby"
end
say("Hello...")
3 Answers
Clayton Perszyk
Treehouse Moderator 48,850 PointsHey Ian,
You just puts text in the method:
def say(text)
puts text
end
say("Ruby")
Clayton Perszyk
Treehouse Moderator 48,850 Pointsyou only need to puts text, and pass in "Ruby" as the argument
Ian Dunn
1,178 PointsSorry still trying to wrap my head around it... so perhaps something like this ...
def say(text) text = "hello, Ruby" end
print say
Clayton Perszyk
Treehouse Moderator 48,850 PointsYeah, no problem. Glad I could help.
Ian Dunn
1,178 PointsIan Dunn
1,178 PointsJust got it, before seeing this. Yay! Exciting. Thanks for helping me Clayton!