From 3a854998a64a3653ae17dfd959ee45800ebfaf15 Mon Sep 17 00:00:00 2001 From: Wes Delp Date: Wed, 1 Jun 2016 09:11:08 -0400 Subject: [PATCH 1/2] Finished parser --- parser.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/parser.rb b/parser.rb index adaad3e..a980ac6 100644 --- a/parser.rb +++ b/parser.rb @@ -1,3 +1,5 @@ def word_in_string?(word, string) - # implement with your code here + words = string.split(/[\s_\-.]/) + found = words.find { |w| w == word } + return found ? :yes : :no end From b7bd6ebb1abc2cd95c9ee27af8d5edf17e2dc24c Mon Sep 17 00:00:00 2001 From: Wes Delp Date: Thu, 2 Jun 2016 10:33:26 -0400 Subject: [PATCH 2/2] Removed imlicit return --- parser.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parser.rb b/parser.rb index a980ac6..316e68d 100644 --- a/parser.rb +++ b/parser.rb @@ -1,5 +1,5 @@ def word_in_string?(word, string) words = string.split(/[\s_\-.]/) found = words.find { |w| w == word } - return found ? :yes : :no + found ? :yes : :no end