Module: Enumerable
- Defined in:
- lib/test-factory/core_ext.rb
Overview
Time
Instance Method Summary collapse
-
#alphabetize ⇒ Object
Use for getting a natural sort order instead of the ASCII sort order.
-
#alphabetize! ⇒ Object
Use for sorting an Enumerable object in place.
Instance Method Details
#alphabetize ⇒ Object
Use for getting a natural sort order instead of the ASCII sort order.
76 77 78 |
# File 'lib/test-factory/core_ext.rb', line 76 def alphabetize sort { |a, b| grouped_compare(a, b) } end |
#alphabetize! ⇒ Object
Use for sorting an Enumerable object in place.
82 83 84 |
# File 'lib/test-factory/core_ext.rb', line 82 def alphabetize! sort! { |a, b| grouped_compare(a, b) } end |