Project

General

Profile

Actions

Bug #12682

closed

Hash#flatten(level) does not recursively flatten inner hashes.

Added by krobi64 (Kristine Robison) over 7 years ago. Updated over 7 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
ruby -v:
2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15]
[ruby-core:76937]

Description

pry
[1] pry(main)> x = {a: {b: 1, c:2}}
=> {:a=>{:b=>1, :c=>2}}
[2] pry(main)> x.flatten(1)
=> [:a, {:b=>1, :c=>2}]
[3] pry(main)> x.flatten(2)
=> [:a, {:b=>1, :c=>2}]
Actions

Also available in: Atom PDF

Like0
Like0