Module: Enumerable

Defined in:
lib/test-factory/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.



62
63
64
# File 'lib/test-factory/core_ext.rb', line 62

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

#alphabetize!Object

Use for sorting an Enumerable object in place.



68
69
70
# File 'lib/test-factory/core_ext.rb', line 68

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