require"minitest/autorun"classPigLatinTranslatorLATINATOR=->(word){word=~/\w/?"#{word[1..-1]}#{word[0]}ay":word}defself.translatesentencesentence.split(' ').map(&LATINATOR).join(' ')endendclassPigLatinTranslatorTest<MiniTest::Testdeftest_sentence_without_punctuationtranslated_sentence=PigLatinTranslator.translate("Pig latin is cool")assert_equal"igPay atinlay siay oolcay",translated_sentenceenddeftest_sentence_with_punctuationtranslated_sentence=PigLatinTranslator.translate("Hello world !")assert_equal"elloHay orldway !",translated_sentenceendend
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Ruby 2.6