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 (Retired) Ruby Methods Methods in Ruby

There is an error in this quiz, it says that you can use ? in a Ruby method name and I believe this is incorrect.

There is an error in this quiz, it says that you can use ? in a Ruby method name and I believe this is incorrect.

1 Answer

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,860 Points

Hi Derrick,

Sorry, no error in the quiz. :)

Methods can have a question mark in the name (variables cannot) but only at the end of the name. So, def method_name? is valid, but def method?name is not.

When you end a Method name with a question mark, it will return a boolean.

You can read up on some of the naming conventions resources I've found for you. There is github, a blog post by Paul Gross, or the Ruby Learning site.

Hope that helps clear it up for you.

Keep Coding! :dizzy:

Good to know. :-) The video only said ! was allowed.