Module: MoreCoreExtensions::HashSortBang

Defined in:
lib/more_core_extensions/core_ext/hash/sorting.rb

Instance Method Summary collapse

Instance Method Details

#sort!(*args, &block) ⇒ Object



3
4
5
6
7
# File 'lib/more_core_extensions/core_ext/hash/sorting.rb', line 3

def sort!(*args, &block)
  sorted = sort(*args, &block)
  sorted = self.class[sorted.to_a] unless sorted.instance_of?(self.class)
  replace(sorted)
end