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