A subscription is required for viewing this video. Enroll now
to get full access to all Code School courses and content.
Cool presentation, tks Caike.
Interesting idiom, I will try it later! However, I still feel it is better to stick with initialize (only because it is the convention and I don't think there are lots of advantages in using the Struct idiom).
Where are the pitfalls? Abraço!
Inherit initialize from Struct? Neat
Nice. I remember this stuff being tricky in Ruby bits II. Helps to take a new look at it.
Never use Struct before, good tutorial and helps me understand more.
Short and Sweet!
One day this will click, but for now I'M PULLING MY HAIR OUT #thatisall
This is clever and enlightening. Well done.
Still new to ruby so maybe I'm missing something... It looks really neat but taking away a classes possibility of inheritance just to save a few lines of code? I don't know, doesn't feel right in terms of flexibilty. Apart from that: very good video!
That was awesome Caike, Thanks!
Awesome! Would love to see more complex Ruby stuff. I liked the duration as well.
Very clever and compact - I like it!
Learn how to use Ruby Structs as class constructors in Ruby. We'll review the benefits and the potential pitfalls of this approach.
You need to be an enrolled student in order to view this video and subscribe.
In order to bookmark this content, we'll need to add it to a Code
Already have an account?