4 5 6 7
# File 'lib/extentions/array.rb', line 4 def deep_sort map { |element| element.is_a?(Array) ? element.deep_sort : element } .sort_by { |el| el.is_a?(Array) ? el.first.to_s : el.to_s } end