Method: XeroRuby::StringSerialization#gsubbed

Defined in:
lib/xero-ruby/string_serialization.rb

#gsubbed(str, pattern, extra = "") ⇒ Object



38
39
40
41
42
43
44
# File 'lib/xero-ruby/string_serialization.rb', line 38

def gsubbed(str, pattern, extra = "")
  key_map_scronyms = {}
  str = str.gsub(pattern) do
    extra + (key_map_scronyms[Regexp.last_match(1)] || capitalize_first(Regexp.last_match(1)))
  end
  str
end