Created
August 16, 2019 18:53
-
-
Save rush2sk8/768d1370e0f3f9907aa6c79a5aafeaca to your computer and use it in GitHub Desktop.
Revisions
-
rush2sk8 created this gist
Aug 16, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ def deep_values(h, acc = []) return [nil] if h.nil? case h when Hash return deep_values(h.values) when Array acc.push(*h.map { |v| deep_values(v) }) else acc.push(h) end acc.flatten end