Project

name_abbr

0.0
No commit activity in last 3 years
No release in over 3 years
Abbreviate full names like John D.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.7
~> 0.9.0
~> 10.0
 Project Readme

Gem Version

name_abbr

A simple gem to take a full name and abbreviate it like "John D."

installation

gem install name_abbr

usage

irb(main):001:0> require 'name_abbr'
=> true
irb(main):002:0> NameAbbr.abbr_name('john', 'doe')
=> "John D."
irb(main):003:0> NameAbbr.abbr_name('john', '')
=> "John"
irb(main):004:0> NameAbbr.abbr_name('john', nil)
=> "John"
irb(main):010:0> NameAbbr.abbr_full_name('John')
=> "John"
irb(main):011:0> NameAbbr.abbr_full_name('john doe')
=> "John D."
irb(main):012:0> NameAbbr.abbr_full_name('john     doe')
=> "John D."
irb(main):012:0> NameAbbr.abbr_full_name('john henry doe')
=> "John D."