Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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,107 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,107 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