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 trial3 Answers
candacemielke
6,466 PointsThe parenthesis after a method is what indicates to the interpreter that it is a method, and also indicates that you are calling it into action.
Leo Tank
Full Stack JavaScript Techdegree Student 36,270 PointsIn Ruby parenthesis after method call are redundant.
Ravi Kalsi
780 PointsHere are two ways to define a method. Both are the same. The first is the original way, the second is the common way.
def full_name() ... end
def full_name ... end
Note the (). The parenthesis mark that it is a function (as opposed to a variable). However in Ruby, parentheses can usually be omitted. It makes the text easier to read.
These are also the same: puts name.full_name() puts name.full_name
To improve clarity, some people will include () to make it extra clear that it is a function.