Your Bright Metaprogramming Future: Mistakes You'll Make (and How to Fix Them)
summary
A concrete roadmap: discovering delayed_job’s send_later leads to reflexive use of send/send_later and a bloated case-tree; refactoring moves the dynamic call into a Formatter class, replaces bag-of-args with explicit parameters, turns formatters into objects, and collapses duplicated methods so the formatter becomes smaller and prettier and cyclomatic complexity drops. Method_missing discussion lists three bugs — no super, no respond_to_missing, no defined_method memoization — and shows anonymous module inclusion's your BFF (const_get or hash) as a workable encapsulation.
AI-written summary · about
chapters (4)
related talks
38mMy Meta Moments
25mIn Defense of Ruby Metaprogramming
26mMeta-programming for Dummies
32m'method_missing' Should be Missing
18mMetaprogramming: Unraveling the Magic
28mDiving into Dynamic: Demystefying Metaprogrammaing with Ruby
01h 12mRuby Best Practice Patterns
25mRefactoring: The ASMR of Programming Talks
