Just like many otherÂ ruby developers, IÂ wanted to learn metaprogramming to make the leap from Ruby novice toÂ Ruby pro.Â But,Â approaching the subjectÂ feltÂ a bit intimidating. I tried to learn metaprogramming several times and everyÂ time I tried, all available materials wereÂ referring to even more complicated and less known conceptsÂ such as: eigenclasses, singleton classes,Â ruby object model, classes being objects themselves, etc.
So, I spent several months readingÂ about all these conceptsÂ and synthesisedÂ all available material. At the end, it just "clicked"!Â ItÂ turned out to be very simple!Â TheÂ problem was that there was no single resource where all this concepts were put together. So, IÂ decided to produceÂ this corse. I hope it will save your time and youÂ will find itÂ useful.
This video course will teach you ruby metaprogramming by introducing small, simple and less known ruby insights in each video. And once you learn them, metaprogramming will just start to make sense.
At the end of the course, you will:
- Be better Ruby developer who can write elegant code using Ruby's metaprogramming features.
- Make your test code more concise by writing test thatÂ dynamically generateÂ code that covers all testÂ cases.
- Be able to understand and explain the magic behind the code/syntax in all popular gems.
- Better understand the Ruby language.
- and of course write your own DSL's for your businessÂ domainÂ (just like rspec, rake, etc.).
Metaprogramming is such an integral part of the Ruby language, that in order to learn it, you need to understand the specific language features of Ruby. This features are less known and not covered inÂ books. But, once you are introduced to them, metaprogramming starts to make sense. That's why, the courseÂ will start by introducing several key Ruby languageÂ insights. After this section, you will understand why is it that some method or variable is notÂ available in some scope and available in othersÂ or how scope changes in your code and more.
In the second section of the course, weÂ will cover all the SDK methods that are involved in metaprogramming. Along the way, we will go through several examples that demystifies magic behind most popular gem code as well.
In the last section of the course, we will putÂ everything we'veÂ learnt into practice and will buildÂ our own rspec, domain specific language and some of the rails most popular magical methods.