Class: Array

Inherits:
Object
  • Object
show all
Defined in:
lib/extentions/array.rb

Instance Method Summary collapse

Instance Method Details

#deep_sortObject



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