Sha256: f27285b74f840db53a08e4691edc176cef668e6d47a66a59d7ee154662a5ebe3
Contents?: true
Size: 639 Bytes
Versions: 14
Compression:
Stored size: 639 Bytes
Contents
# frozen_string_literal: true module Synvert::Core # DeleteAction to delete child nodes. class Rewriter::DeleteAction < Rewriter::Action def initialize(instance, *selectors) super(instance, nil) @selectors = selectors end def calculate_position @begin_pos = @selectors.map { |selector| @node.child_node_range(selector) }.compact.map(&:begin_pos).min @end_pos = @selectors.map { |selector| @node.child_node_range(selector) }.compact.map(&:end_pos).max squeeze_spaces remove_comma end # The rewritten code, always empty string. def rewritten_code '' end end end
Version data entries
14 entries across 14 versions & 1 rubygems