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
Cristian Daniel Marquez Barrios
8,900 Points* before variable
In this module:
module FormatAttributes
def formats(*attributes)
@format_attributes = attributes
end
def format_attributes
@format_attributes
end
end
why you put * before *attributes?
3 Answers
Nicholas Olsen
Front End Web Development Techdegree Student 19,342 PointsThe * before attributes means formats() can accept any number of arguments.
Cristian Daniel Marquez Barrios
8,900 Pointsits like create an array on @format_attributes?
Nicholas Olsen
Front End Web Development Techdegree Student 19,342 PointsYes.