Mô tả

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.).

Course overview

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.

Bạn sẽ học được gì

Yêu cầu

Nội dung khoá học

4 sections

Intoduction

2 lectures
Welcome
05:06
Course layout & Contact details
02:07

Ruby Insights

21 lectures
Everything is an Object
03:09
Open classes, DuckType, Runnable code
07:26
Material Revision
02:19
Lectures 2, 3 and 4
5 questions
Classes are objects
12:57
Additional material & Revision: Classes are objects
05:16
Scopes
13:36
Additional material & Revision: Scopes
03:14
Covers: Classes are objects + Scopes
10 questions
Classes are modules with hierarchy
14:50
Additional material & Revision: Classes are Modules
01:48
Inheritance hierarchy
11:51
Additional material & Revision: Inheritance Hierarchy
01:56
Classes are Modules & Inheritance Hierarchy
5 questions
Where variables and methods live?
11:12
Revision: Where variables & methods live?
01:16
Method lookup
09:46
Revision: Method lookup
02:16
Variables & Variable Scope
10:38
Ruby Object Model
07:58
Blocks, Closures, Binding
09:03

Metaprogrammer's Toolkit

10 lectures
Querying about classes / methods / variables
14:39
Practice: Imitating Custom Language Keywords
05:17
Defining classes / methods / variables
19:44
Practice: Creating our own "attr_accessor" method
04:20
Changing existing classes / methods / variables
10:16
Practice: Implementing Rails’ “alias_method_chain"
05:56
Evaluate code in different contexts
07:30
Hook into changes in classes / methods / variables
09:40
Practice: Write your own "ActiveSupport::Concern"
15:02
Practice: Going through Rails' ActiveSupport::Concern code
11:12

Practice and Excersises

9 lectures
Task: Write your own .tap() method in Ruby 1.8
01:11
Solution: Write and improve the .tap() method
05:11
Task: Implement "Struct" class
00:54
Solution: Custom implementation of "Struct" class
11:10
Task: Write DSL for HTML code generation
00:58
Solution: Write DSL for HTML code generator
17:00
Example: Evaluating code in "isolated" scope
05:12
Example: Sharing scopes among specific Classes or methods
10:59
Exercise: Demystifying Rails magic
01:47

Đánh giá của học viên

Chưa có đánh giá
Course Rating
5
0%
4
0%
3
0%
2
0%
1
0%

Bình luận khách hàng

Viết Bình Luận

Bạn đánh giá khoá học này thế nào?

image

Đăng ký get khoá học Udemy - Unica - Gitiho giá chỉ 50k!

Get khoá học giá rẻ ngay trước khi bị fix.