Class: Kiba::Extend::Utils::MarcNameCleaner

Inherits:
Object
  • Object
show all
Defined in:
lib/kiba/extend/utils/marc_name_cleaner.rb

Overview

Callable service to clean punctuation off end of name string

Since:

  • 4.0.0

Instance Method Summary collapse

Instance Method Details

#call(value) ⇒ String

Parameters:

  • value (String)

Returns:

  • (String)

Since:

  • 4.0.0



14
15
16
17
18
# File 'lib/kiba/extend/utils/marc_name_cleaner.rb', line 14

def call(value)
  value.sub(/,$/, "")
    .sub(/([^ .].)\.$/, '\1')
    .sub(/,\.?$/, "")
end