10 lines
168 B
Ruby
10 lines
168 B
Ruby
|
class Acronym
|
||
|
def self.abbreviate(long_name)
|
||
|
abbrev = ""
|
||
|
long_name.split(/[\W-]+/).each do |word|
|
||
|
abbrev += word[0]
|
||
|
end
|
||
|
abbrev.upcase
|
||
|
end
|
||
|
end
|