Reverse the words, move the vowels and downcase everything
One-liners are good fun, but the world doesn't really need more of them. That said, they don't have to be so unreadable. What will your future brain say a year from now if you have to maintain that function?
Here's an approach illustrating a scalable technique to make even long &quot;one-liners&quot; readable by (1) using lines generously, (2) indenting code in the manner of a pretty-printed data structure to convey the logic's hierarchy (code is data, after all), and (3) including comments to assist the reader with the logic and intent.
def funky_words(s)
  (
    # Split into words.
    s
    .split
    .reverse_each
    .map { |word|
      # Within each word, push vowels to the end, while preserving
      # original order within consonants and vowels.
      word
      .each_char
      .sort_by.with_index { |c, i| &quot;aeiouAEIOU&quot;.include?(c) ? [1, i] : [0, i] }
      .join
    }
    # Rejoin the new words.
    .join(&quot; &quot;)
  )
end