Sha256: 3487d8ff62f400578b5bcd4054498af957d90cf74b857c5ba74fc1f4776e4bbc
Contents?: true
Size: 293 Bytes
Versions: 21
Compression:
Stored size: 293 Bytes
Contents
# frozen_string_literal: true module I18n::Tasks module StringInterpolation module_function def interpolate_soft(s, t = {}) return s unless s t.each do |k, v| pat = "%{#{k}}" s = s.gsub pat, v.to_s if s.include?(pat) end s end end end
Version data entries
21 entries across 21 versions & 1 rubygems