Method: Immutable::Hash#sort_by
- Defined in:
- lib/immutable/hash.rb
#sort_by {|key, value| ... } ⇒ Vector
Return a Vector which contains all the ‘[key, value]` pairs in this Hash as two-element Arrays. The order which the pairs will appear in is determined by passing each pair to the code block to obtain a sort key object, and comparing the sort keys using `#<=>`.
542 543 544 |
# File 'lib/immutable/hash.rb', line 542 def sort_by Vector.new(super) end |