Sha256: 89034a537c4d52b01bb7042677eb1a47cd0c633175d442acb6e5ad58a7ca66b9
Contents?: true
Size: 724 Bytes
Versions: 26
Compression:
Stored size: 724 Bytes
Contents
# frozen_string_literal: true module Synvert::Core # RemoveAction to delete code. class Rewriter::DeleteAction < Rewriter::Action def initialize(instance, *selectors) super(instance, nil) @selectors = selectors end # Begin position of code to replace. # # @return [Integer] begin position. def begin_pos @selectors.map { |selector| @node.child_node_range(selector).begin_pos }.min end # End position of code to replace. # # @return [Integer] end position. def end_pos @selectors.map { |selector| @node.child_node_range(selector).end_pos }.max end # The rewritten code, always empty string. def rewritten_code '' end end end
Version data entries
26 entries across 26 versions & 1 rubygems