Hacker News new | ask | show | jobs
by orf 1275 days ago
I read that comment, but unless you know Ruby most of the specifics are meaningless
1 comments

think of pattern matching being implemented via methods on an object which return a hash/array (deconstruct and deconstruct_keys).

ActiveRecord objects wrap an hash of attributes, but are also normal objects which have instance variables and methods plus some hooks and specific API that can be expected to be overriden.

So it's unclear how the method should behave: just read from the hash? Invoke some specific method? Invoke any method?

The answer may be non obvious.