Class: Kiba::Extend::Utils::MarcRoleTermCleaner
- Inherits:
-
Object
- Object
- Kiba::Extend::Utils::MarcRoleTermCleaner
- Defined in:
- lib/kiba/extend/utils/marc_role_term_cleaner.rb
Overview
Callable service to clean punctuation off end of name string
Instance Method Summary collapse
Instance Method Details
#call(value) ⇒ String
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/kiba/extend/utils/marc_role_term_cleaner.rb', line 14 def call(value) value.sub(/,$/, "") .sub(/([^ .].)\.$/, '\1') .sub(/^\((.*)\)$/, '\1') .sub(/ ?\((work|expression|manifestation|item)\)/, "") .sub(/^comp$/i, "compiler") .sub(/^comp\. and ed$/i, "compiler|editor") .sub(/^ed$/, "editor") .sub(/^engr$/, "engraver") .sub(/^illus$/, "illustrator") .sub(/^pbl$/, "publisher") .sub(/^tr$/, "translator") # rubocop:todo Layout/LineLength .sub(/^(engraver|architect|illustrator|publisher|stereotyper)s$/, '\1') # rubocop:enable Layout/LineLength end |