lib/iev/data_conversions.rb in iev-0.3.4 vs lib/iev/data_conversions.rb in iev-0.3.5

- old
+ new

@@ -1,11 +1,11 @@ # frozen_string_literal: true # (c) Copyright 2020 Ribose Inc. # -module IEV +module Iev module DataConversions refine String do def decode_html! replace(decode_html) nil @@ -16,13 +16,13 @@ end # Normalize various encoding anomalies like `\uFEFF` in strings def sanitize! unicode_normalize! - gsub!("\uFEFF", "") - gsub!("\u2011", "-") - gsub!("\u00a0", " ") + delete!("\uFEFF") + tr!("\u2011", "-") + tr!("\u00a0", " ") gsub!(/[\u2000-\u2006]/, " ") strip! nil end @@ -30,10 +30,10 @@ def sanitize dup.tap(&:sanitize!) end def to_three_char_code - IEV::Iso639Code.three_char_code(self).first + Iev::Iso639Code.three_char_code(self).first end end end end