Use TreeRewriter#replace
Replaces the code of the source range range with content.
range
content
Parameters:
Returns:
self
Raises:
when clobbering is detected
167 168 169
# File 'lib/parser/source/rewriter.rb', line 167 def replace(range, content) append Rewriter::Action.new(range, content) end