Module: Enumerable
- Defined in:
- lib/rubustrings/action.rb
Instance Method Summary collapse
Instance Method Details
#stable_sort ⇒ Object
184 185 186 |
# File 'lib/rubustrings/action.rb', line 184 def stable_sort sort_by.with_index { |x, idx| [x, idx] } end |
#stable_sort_by ⇒ Object
188 189 190 |
# File 'lib/rubustrings/action.rb', line 188 def stable_sort_by sort_by.with_index { |x, idx| [yield(x), idx] } end |