Sha256: 0930d5e1ccf18b5009bcbea8b6b698badc0dfcd0096e5a62c09dfd6e513a992a
Contents?: true
Size: 317 Bytes
Versions: 216
Compression:
Stored size: 317 Bytes
Contents
module BookKeeping VERSION = 4 end class Acronym def self.abbreviate(phrase) [].tap do |letters| each_word(phrase) do |word| letters << word[0].upcase end end.join end def self.each_word(phrase) phrase.scan(/[A-Z]+[a-z]*|[a-z]+/) do |word| yield word end end end
Version data entries
216 entries across 216 versions & 1 rubygems