def replace_on(*types)
      types.map do |type|
        self.class.send :define_method, "on_#{type}" do |node|
          if captures = match?(node) # rubocop:disable Lint/AssignmentInCondition
            @match_index += 1
            execute_replacement(node, captures)
          end
          super(node)
        end
      end
    end
def replace_on(*types)
      types.map do |type|
        self.class.send :define_method, "on_#{type}" do |node|
          if captures = match?(node) # rubocop:disable Lint/AssignmentInCondition
            @match_index += 1
            execute_replacement(node, captures)
          end
          super(node)
        end
      end
    end
Generate methods for all affected types.
 @see Fast.replace