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 Objects and Classes Variables and Methods Variables

For me, this code doesn't pass unless you pass in the new 4 parameters?

For me, if I update this line to: def initialize(title, first_name, middle_name, last_name)

and instantiate like this: name = Name.new("Mr.")

I get an error that there are 3 parameters missing.

You need to do this: name = Name.new("Mr.", "Barack","H","Obama") or equivalent yes?

How is it passing in the video?

4 Answers

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

Notice there's a cutscene where Jason changed the fixed return values into instance variables. I assume he also changed his Name.new statement at the bottom of the file as well to include all the attributes, we just don't see that. Yes, it needs to be passed 4 arguments, just like the initialize method suggests.

Thank you

There has to be a better way to present this video.

MICHAEL P
MICHAEL P
5,191 Points

I find that the way that the video jumps around to be confusing. I remember a teacher stating in high school, that if the teacher shows the wrong way of doing something, that the mistake will be what the student learns. Unnecessarily confusing!

Andrew Mayne
Andrew Mayne
5,850 Points

This video jumps too much. If you do exactly as he says it won't pass.