From 3de25ef6c8095339cbf3826fb9d424e23eda0916 Mon Sep 17 00:00:00 2001 From: Joe Reich Date: Sat, 19 Sep 2015 12:23:38 -0400 Subject: [PATCH] write parse --- parser.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/parser.rb b/parser.rb index adaad3e..30b0aa3 100644 --- a/parser.rb +++ b/parser.rb @@ -1,3 +1,4 @@ def word_in_string?(word, string) - # implement with your code here + words = string.split(/[\s_-]/) + words.any?{|w| word == w} ? :yes : :no end