Module: YAMLir::SortedList::ClassMethods

Included in:
YAMLir::SortedList
Defined in:
lib/yamlir/sorted_list.rb

Instance Method Summary collapse

Instance Method Details

#sort(list) ⇒ Object



7
8
9
10
11
12
13
14
15
# File 'lib/yamlir/sorted_list.rb', line 7

def sort list
  list.sort do |a, b|
    if slashes(a) == slashes(b)
      a <=> b
    else
      slashes(a) <=> slashes(b)
    end
  end
end