~/talk

Let's subclass Hash - what's the worst that could happen?

Talkat RubyConf 2018 · 2018-11-28..11-30· [ruby]
slides:none on file

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

  1. 0:00Introduction
  2. 1:47Hashe
  3. 3:02Bugs
  4. 3:44Sample code
  5. 8:27What is self
  6. 11:21Hash super
  7. 13:28Mash keys
  8. 14:12Hash E
  9. 17:36Mash
  10. 18:33Zip
  11. 19:19Sharp Knife
  12. 20:51Dash
  13. 23:17Double Splat
  14. 26:41Merge Hash
  15. 27:37Recap
  16. 32:10PSA
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.