Method: App::Replacer.replace_string
- Defined in:
- lib/core/replacer.rb
.replace_string(line, data) ⇒ Object
Takes a string, replaces all the matchers and returns string.
170 171 172 173 174 175 176 |
# File 'lib/core/replacer.rb', line 170 def self.replace_string(line, data) return nil if line.nil? raise RuntimeError, "Expected String, instead got #{line.class}" unless line.is_a?(String) raise RuntimeError, "Expected Hash, instead got #{data.class}" unless data.is_a?(Hash) line, x, y = process_matchers(line, {}, [], OP_REPLACE, data: data) return line end |