From bf7c1b1fe85413d2b9da0aacb08594b9d44f7795 Mon Sep 17 00:00:00 2001 From: Samuel Priddy Date: Fri, 11 Dec 2015 09:04:54 -0500 Subject: [PATCH 1/2] Initialize with fragile solution (case sensitive for word) --- parser.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parser.rb b/parser.rb index adaad3e..8e5f81d 100644 --- a/parser.rb +++ b/parser.rb @@ -1,3 +1,3 @@ def word_in_string?(word, string) - # implement with your code here + string.scan(/[a-z]+/i).include?(word) ? :yes : :no end From bf65a75dfc87e6aa906ed2ad09712471030c7390 Mon Sep 17 00:00:00 2001 From: Samuel Priddy Date: Mon, 14 Dec 2015 08:17:34 -0500 Subject: [PATCH 2/2] Downcase input, function now case insensitive --- parser.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parser.rb b/parser.rb index 8e5f81d..5552239 100644 --- a/parser.rb +++ b/parser.rb @@ -1,3 +1,3 @@ def word_in_string?(word, string) - string.scan(/[a-z]+/i).include?(word) ? :yes : :no + string.downcase.scan(/[a-z]+/i).include?(word.downcase) ? :yes : :no end