Sign in with:
Oops, a subscription is required to view this video. You can
to watch, or try out all that Code School has to offer with a
free two-day Hall Pass.
Very clever and compact - I like it!
Awesome! Would love to see more complex Ruby stuff. I liked the duration as well.
That was awesome Caike, Thanks!
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!
This is clever and enlightening. Well done.
One day this will click, but for now I'M PULLING MY HAIR OUT #thatisall
Short and Sweet!
Never use Struct before, good tutorial and helps me understand more.
Nice. I remember this stuff being tricky in Ruby bits II. Helps to take a new look at it.
Inherit initialize from Struct? Neat
Where are the pitfalls? Abraço!
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).
Cool presentation, tks Caike.
Learn how to use Ruby Structs as class constructors in Ruby. We'll review the benefits and the potential pitfalls of this approach.