Module: Enumerable

Defined in:
lib/rubustrings/action.rb

Instance Method Summary collapse

Instance Method Details

#stable_sortObject



180
181
182
# File 'lib/rubustrings/action.rb', line 180

def stable_sort
  sort_by.with_index { |x, idx| [x, idx] }
end

#stable_sort_byObject



184
185
186
# File 'lib/rubustrings/action.rb', line 184

def stable_sort_by
  sort_by.with_index { |x, idx| [yield(x), idx] }
end