- This repository is archived
- No longer maintained
- All versions have been removed from https://rubygems.org to free up valuable namespace for other developers.
Generate abbreviations from words
Require Ruby 3.1 or later
require 'abb'
Abb.fold('google') #=> "ggl"
Extending String without namespace pollution
module YourModuleOrClass
using Abb::Refinements
def func
p 'google'.abb #=> "ggl"
p 'Japan'.abb #=> "Jpn"
p 'American Standard Code for Information Interchange'.abb #=> "ASCII"
end
end
'google'.abb #=> NoMethodError