global

def self.shuffle_words(array)

Returns:
  • (Array) -

Parameters:
  • array (Array) --
def self.shuffle_words(array)
    array.each do |string|
        select_words_re = /\S+/
        words = string.scan(select_words_re).shuffle
        string.gsub(select_words_re) { words.pop || '' }
    end
end