diff --git a/grandma.rb b/grandma.rb index 5045e39..f7432cf 100644 --- a/grandma.rb +++ b/grandma.rb @@ -1,13 +1,9 @@ -# Write a speak_to_grandma method. - -# Whatever you say to grandma, she should respond with -# HUH?! SPEAK UP, SONNY! -# unless you shout it (type in all capitals). - -# If you shout, she can hear you (or at least she thinks so) -# and yells back - -# NO, NOT SINCE 1938! - -# However if you say 'I LOVE YOU GRANDMA!', she should respond with -# 'I LOVE YOU TOO PUMPKIN!' +def speak_to_grandma(string) + if string == "I LOVE YOU GRANDMA!" + return "I LOVE YOU TOO PUMPKIN!" + elsif string == string.upcase + return "NO, NOT SINCE 1938!" + else + return "HUH?! SPEAK UP, SONNY!" + end +end \ No newline at end of file