In previous episodes we've used the Struct class in passing to quickly construct classes. This time, we put Struct in the spotlight, and put it through its paces. You'll want to watch this one through even if you're familiar with Struct; you may find it has more tricks up its sleeve than you realized.
Episode 20 · part of Crystaline Ruby
This episode is part of Crystaline Ruby.
Crystaline Ruby has 7 modules and 42 lessons. Watching this episode takes a Pro membership, which includes every course. You can also buy this course on its own.
Pro
$25a month
Or $250 a year. Includes this course and every other Graceful.Dev course.
I really enjoyed this episode. I don’t get the chance to use structs too often in my day-to-day work, but this gave me a refresher-and-then-some that was much needed. Thanks!
I really enjoyed this episode. I don’t get the chance to use structs too often in my day-to-day work, but this gave me a refresher-and-then-some that was much needed. Thanks!
Thanks for this article! Not sure if you care, but there’s a syntax error in the following line;
“No we don’t! The Struct constructor can also take a block. Inside the block we can our own methods, just as we would in a class definition”
What’s the syntax error?
“ Inside the block we can our own methods”
Ooooh, I thought you meant in the code THanks!
—
Avdi Grimm
— original message —
Yeah sorry I didn’t know what to call it.
No worries! Thanks again for the article