The case of the missing method — a Ruby mystery story
summary
A Ruby method lookup mystery gets solved by reproducing the bug in Pry/IRB, inspecting ObjectSpace counts, and writing a small where helper that walks ancestors; the missing method does not live on Class but on the object's singleton class, revealed by filtering methods and checking singleton_class ancestors. The talk shows a working DSL built with instance_eval (City.construct) to create per-city behavior, explains why class methods are really singleton-instance methods, and demos how this causes the undefined method error.
AI-written summary · about
chapters (12)
- 0:00Intro
- 1:20Mike and Jenny
- 6:27Ever heard of Google
- 10:00Smalltalk
- 13:36The phone call
- 14:24What are Singleton classes
- 15:24Budgeting Inc
- 16:15Creating a DSL
- 21:35Singleton classes
- 24:45Mike
- 27:06Ellen
- 28:13Ruby Core Team
related talks
34mThe Case of the Missing Method — A Ruby Mystery Story
29mThe Case of the Missing Method: A Ruby Mystery Story
33mThe Case Of The Missing Method - A Ruby Mystery Story
29mMessenger: The (Complete) Story of Method Lookup
18mMetaprogramming: Unraveling the Magic
33mVenturing into the Spooky Science of Ruby
42mRuby 2 Methodology
32m'method_missing' Should be Missing
