Skip to content

Commit 667dd4e

Browse files
committed
Update acronym solution to work on the new test
1 parent fad6950 commit 667dd4e

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

exercises/practice/acronym/.meta/example.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ def self.abbreviate(phrase)
77
end.join
88
end
99

10-
def self.each_word(phrase)
11-
phrase.scan(/[A-Z]+[a-z]*|[a-z]+/) do |word|
12-
yield word
13-
end
10+
def self.each_word(phrase, &block)
11+
phrase.scan(/[A-Za-z]+(?:'[A-Za-z]+)*/, &block)
1412
end
1513
end

0 commit comments

Comments
 (0)