Files
developer-roadmap/roadmaps/ruby/content/sorting@knmTmlDbyRwZKxuIIVbwn.md
Arik Chakma 274082fd77 feat: clean roadmap content and sync scripts (#10181)
* refactor: clean to roadmap content

* refactor: move shared helpers into scripts/lib
2026-07-28 05:45:17 +06:00

943 B

Sorting in Enumerable

The Enumerable module in Ruby provides several methods for sorting collections. These methods allow you to arrange elements in ascending or descending order based on their natural ordering or a custom comparison logic. The most common sorting methods include sort, which returns a new sorted array, and sort_by, which sorts based on the result of a block applied to each element. You can also use min, max, minmax to find the smallest, largest, or both smallest and largest elements in a collection, respectively.

Visit the following resources to learn more: