Let's subclass Hash - what's the worst that could happen?
summary
Shows concrete failures from subclassing Hash: an indifferent-access merge that returns a plain Hash until code injects the module (fixed by applying the module to super's result), a Mash that breaks when API keys collide with 178 public methods (method_missing causes surprising conflicts and the alias hack busts the VM method cache), and a Dash where double-splat uses the VM's to_hash path so property logic never runs (a VM-level limitation). Uses Pry and Byebug to inspect state and recommends replacing Hashie mash with JSON+OpenStruct for many APIs.
AI-written summary · about
chapters (16)
- 0:00Introduction
- 1:47Hashe
- 3:02Bugs
- 3:44Sample code
- 8:27What is self
- 11:21Hash super
- 13:28Mash keys
- 14:12Hash E
- 17:36Mash
- 18:33Zip
- 19:19Sharp Knife
- 20:51Dash
- 23:17Double Splat
- 26:41Merge Hash
- 27:37Recap
- 32:10PSA








