Skip to content

Instantly share code, notes, and snippets.

Created September 7, 2014 00:31
Show Gist options
  • Save anonymous/d14d213fe14bdb606bfa to your computer and use it in GitHub Desktop.
Save anonymous/d14d213fe14bdb606bfa to your computer and use it in GitHub Desktop.
def vowels(any_string)
vowel = ["a","e","i","o","u"]
if vowel.include? any_string[0]
true
else
false
end
end
def first_letter(words)
words[0]
end
def first_two(words)
words[0..1]
end
def translate(any_string)
if vowels(any_string) == true && any_string.include?(" ")
any_string.map { |word| word + "ay " }
elsif vowels(any_string) == true
any_string + "ay"
elsif vowels(any_string) == false
any_string[1..-1] + first_letter + "ay"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment