From: ruby-core@... Date: 2015-12-06T05:18:03+00:00 Subject: [ruby-core:71853] [Ruby trunk - Bug #11776] [Open] dig and custom objects Issue #11776 has been reported by Marc-Andre Lafortune. ---------------------------------------- Bug #11776: dig and custom objects https://bugs.ruby-lang.org/issues/11776 * Author: Marc-Andre Lafortune * Status: Open * Priority: Normal * Assignee: Yukihiro Matsumoto * ruby -v: 2.3.0 preview * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN ---------------------------------------- Although currently undocumented and untested, it is possible to `dig` objects of any class that implements `dig`: class Foo def dig(x, *) 40 + x end end {hello: Foo.new}.dig(:hello, 2) # => 42 This seems actually quite nice to me. Matz, could you confirm that this is part of the new feature? I'll fix the documentation and add some basic tests -- https://bugs.ruby-lang.org/