Sha256: fed359c1cc2c544635fdb42c0719d67f9c9cc78040eee26874a4e059eeb33c3c
Contents?: true
Size: 317 Bytes
Versions: 156
Compression:
Stored size: 317 Bytes
Contents
module BookKeeping VERSION = 2 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
156 entries across 156 versions & 1 rubygems