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

Ian Dunn
Ian Dunn
1,178 Points

def 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?

say.rb
def say(text)
  puts text+"Ruby"
end

say("Hello...")

3 Answers

Clayton Perszyk
MOD
Clayton Perszyk
Treehouse Moderator 48,850 Points

Hey Ian,

You just puts text in the method:

def say(text)
  puts text
end

say("Ruby")
Ian Dunn
Ian Dunn
1,178 Points

Just got it, before seeing this. Yay! Exciting. Thanks for helping me Clayton!

Clayton Perszyk
MOD
Clayton Perszyk
Treehouse Moderator 48,850 Points

you only need to puts text, and pass in "Ruby" as the argument

Ian Dunn
Ian Dunn
1,178 Points

Sorry still trying to wrap my head around it... so perhaps something like this ...

def say(text) text = "hello, Ruby" end

print say