Replies: 1 comment
-
|
Not fully shutting this down, and I'm interested in the what other maintainers have to say about this, but I'm probably a soft "no".
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I’ve noticed that The Odin Project is an excellent resource for learning Ruby, but the metaprogramming topic is currently missing except some intro at Ruby on Rails Advanced Topics. I believe this should be included as part of the Ruby course. I’d like to contribute by adding lessons on this subject.
I propose introducing a new section titled “Advanced Ruby” within the “Ruby course”. After completing this section, learners will gain a solid understanding of dynamic class and method creation, enabling them to apply the DRY principle more confidently and effectively.
here are the topics for the lessons I want to cover:
Open Classes
Ruby lets you reopen existing classes and add or change methods without inheritance.
Runtime Method Definition (
define_method)Methods can be created dynamically while the program is running, often based on data or conventions.
Method Lookup & Hooks
Hooks like
method_missingandmethod_addedlet you intercept or react to how methods are called or defined.Reflection / Introspection
Ruby objects can examine themselves to see what methods, variables and ancestors they have.
Code Evaluation (
eval,class_eval,instance_eval)Ruby can execute code dynamically in different contexts, allowing powerful but risky behavior changes.
Modules and Mixins
Modules let you compose and inject behavior into classes, altering method lookup cleanly and predictably.
Beta Was this translation helpful? Give feedback.
All reactions