Sha256: 04b59d4aad032a7d370b286b184fb1ca3d4440dd406f31463273dd60a3d12efd
Contents?: true
Size: 634 Bytes
Versions: 54
Compression:
Stored size: 634 Bytes
Contents
module Parser module Source ## # @api private # 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
54 entries across 54 versions & 2 rubygems