Method: Immutable::Vector#sort_by
- Defined in:
- lib/immutable/vector.rb
#sort_by {|element| ... } ⇒ Vector
Return a new Vector with the same items, but sorted. The sort order is determined by mapping the items through the given block to obtain sort keys, and then sorting the keys according to their natural sort order (‘#<=>`).
708 709 710 |
# File 'lib/immutable/vector.rb', line 708 def sort_by self.class.new(super) end |