From 994de97db4704a7bc50e452b153d743e8c96c57f Mon Sep 17 00:00:00 2001 From: marcandre Date: Tue, 8 Dec 2015 05:21:11 +0000 Subject: * array.c: Improve and fix documentation for Array#dig [#11776] * hash.c: ditto * struct.c: ditto * test_hash.rb: Add basic test for user defined `dig`. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52941 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- struct.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'struct.c') diff --git a/struct.c b/struct.c index cebc445a43..a2aa708eff 100644 --- a/struct.c +++ b/struct.c @@ -1130,8 +1130,9 @@ rb_struct_size(VALUE s) * call-seq: * struct.dig(key, ...) -> object * - * Extracts the nested struct value specified by the sequence of key - * objects. + * Extracts the nested value specified by the sequence of idx + * objects by calling +dig+ at each step, returning +nil+ if any + * intermediate step is +nil+. * * klass = Struct.new(:a) * o = klass.new(klass.new({b: [1, 2, 3]})) -- cgit v1.2.3