def sort_by(&transformer)
      return sort unless block_given?
      block = ->(x) { Erlang.from(transformer.call(x)) }
      array = super(&block)
      array.map! { |k, v| next Erlang::Tuple[k, v] }
      return List.from_enum(array)
    end
def sort_by(&transformer)
      return sort unless block_given?
      block = ->(x) { Erlang.from(transformer.call(x)) }
      array = super(&block)
      array.map! { |k, v| next Erlang::Tuple[k, v] }
      return List.from_enum(array)
    end
Return a {List} which contains all the `[key, value]` pairs in this `Hash`
 as two-element `Tuple`s. 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 `#<=>`.

 @see ::Enumerable#sort_by

 @example
   m = Erlang::Map["Dog" => 1, "Elephant" => 2, "Lion" => 3]
   m.sort_by { |key, value| key.size }
   # => Erlang::List[Erlang::Tuple["Dog", 1], Erlang::Tuple["Lion", 3], Erlang::Tuple["Elephant", 2]]

 @yield [key, value] Once for each key/value pair.
 @yieldreturn a sort key object for the yielded pair.
 @return [List]