Skip to content

Latest commit

 

History

History
10 lines (7 loc) · 249 Bytes

recurse.md

File metadata and controls

10 lines (7 loc) · 249 Bytes

Array#recurse

require 'facets/array/recurse'

Apply a block to array, and recursively apply that block to each sub-array or +type+.

a = ["a", ["b", "c", nil], nil]
r = a.recurse{|a| a.compact!}
r.assert == ["a", ["b", "c"]]