diff --git a/Gemfile.lock b/Gemfile.lock index e283e8f..b050908 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -28,3 +28,6 @@ PLATFORMS DEPENDENCIES pry rspec + +BUNDLED WITH + 1.10.3 diff --git a/parser.rb b/parser.rb index adaad3e..944c7ae 100644 --- a/parser.rb +++ b/parser.rb @@ -1,3 +1,10 @@ def word_in_string?(word, string) # implement with your code here + words = string.scan /(^|[^a-zA-Z])#{Regexp.quote(word)}($|[^a-zA-Z])/ + case words.count>0 + when true + :yes + else + :no + end end