Method: Sequel::SequelMethods#recursive_map
- Defined in:
- lib/sequel/core.rb
#recursive_map(array, converter) ⇒ Object
Convert each item in the array to the correct type, handling multi-dimensional arrays. For each element in the array or subarrays, call the converter, unless the value is nil.
222 223 224 225 226 227 228 229 230 |
# File 'lib/sequel/core.rb', line 222 def recursive_map(array, converter) array.map do |i| if i.is_a?(Array) recursive_map(i, converter) elsif !i.nil? converter.call(i) end end end |