Method: Parser::Source::TreeRewriter#replace

Defined in:
lib/parser/source/tree_rewriter.rb

#replace(range, content) ⇒ Rewriter

Replaces the code of the source range ‘range` with `content`.

Parameters:

  • range (Range)
  • content (String)

Returns:

Raises:



193
194
195
# File 'lib/parser/source/tree_rewriter.rb', line 193

def replace(range, content)
  combine(range, replacement: content)
end