Sha256: b15c34c7ccf33141b98b203ad9ca6ece72e52c1aaf4b9e0804792b9cf228a5ad
Contents?: true
Size: 602 Bytes
Versions: 6
Compression:
Stored size: 602 Bytes
Contents
module Parser module Source class Rewriter::Action attr_reader :range, :replacement def initialize(range, replacement='') @range, @replacement = range, replacement freeze end def to_s if @range.length == 0 && @replacement.empty? 'do nothing' elsif @range.length == 0 "insert #{@replacement.inspect}" elsif @replacement.empty? "remove #{@range.length} character(s)" else "replace #{@range.length} character(s) with #{@replacement.inspect}" end end end end end
Version data entries
6 entries across 6 versions & 1 rubygems