Meta-programming for Dummies
summary
Shows how Ruby meta-programming replaces repetitive getters with a custom attribute_accessor implementation, how ActiveRecord introspects schema to add attributes, and how the workflow gem style DSL generates state-transition methods so ten states avoid hundreds of hand-written methods. Reports using a DSL to factor attachments across 20–30 models, notes hidden includes can cost hours debugging, recommends keeping meta code modular, documenting and testing behavior, and avoiding catch-all method_missing unless you also implement respond_to_missing.
AI-written summary · about
chapters (12)
- 0:00Introduction
- 0:26Why metaprogramming
- 2:35Definition
- 4:45ActiveRecordBase
- 8:49Summary
- 9:22Start method opening
- 10:14Modify behavior
- 12:02Integrate
- 12:58Keep it independent
- 14:29Readability
- 17:04Risks
- 17:43Questions
related talks
26mMeta-programming for Dummies
25mIn Defense of Ruby Metaprogramming
18mMetaprogramming: Unraveling the Magic
38mMy Meta Moments
28mDiving into Dynamic: Demystefying Metaprogrammaing with Ruby
31mSeeing Metaprogramming and Lambda Function Patterns in Ruby
36mMetaprogramming? Not good enough!
34mMetaprogramming for generalists
