Project

General

Profile

Actions

Misc #15739

closed

Improvements needed to documentation of Hash#dig, Array#dig and OpenStruct#dig

Added by CaryInVictoria (Cary Swoveland) over 5 years ago. Updated about 5 years ago.

Status:
Rejected
Assignee:
-
[ruby-core:<unknown>]

Description

The documentation of these three methods fails to explain how they interact. For example:

h = { a: [1,2,3] }
h.dig(:a, 1)  #=> 2

Hash#dig is used first:

a = h.dig(:a) #=> [1,2,3]

Then Array#dig is invoked:

a.dig(1)      #=> 2         
Actions #1

Updated by CaryInVictoria (Cary Swoveland) over 5 years ago

  • Subject changed from Improvements needed to documentation of `Hash#dig`, `Array#dig` and `OpenStruct#dig` to Improvements needed to documentation of Hash#dig, Array#dig and OpenStruct#dig

Updated by marcandre (Marc-Andre Lafortune) about 5 years ago

  • Status changed from Open to Rejected

I find the documentation clear, and all three classes include mixed examples as in your example above.

Actions

Also available in: Atom PDF

Like0
Like0Like0