Module: Enumerable

Defined in:
lib/kuali-sakai-common-lib/core-ext.rb

Overview

Time

Instance Method Summary collapse

Instance Method Details

#alphabetizeObject

Use for getting a natural sort order instead of the ASCII sort order.



60
61
62
# File 'lib/kuali-sakai-common-lib/core-ext.rb', line 60

def alphabetize
  sort { |a, b| grouped_compare(a, b) }
end

#alphabetize!Object

Use for sorting an Enumerable object in place.



65
66
67
# File 'lib/kuali-sakai-common-lib/core-ext.rb', line 65

def alphabetize!
  sort! { |a, b| grouped_compare(a, b) }
end