def extract_string(node, array_join_with: nil, array_flatten: false, array_reject_blank: false)
      if %i[sym str int].include?(node.type)
        node.children[0].to_s
      elsif %i[true false].include?(node.type) # rubocop:disable Lint/BooleanSymbol
        node.type.to_s
      elsif node.type == :nil
        ''
      elsif node.type == :array && array_join_with
        extract_array_as_string(
          node,
          array_join_with:    array_join_with,
          array_flatten:      array_flatten,
          array_reject_blank: array_reject_blank
        ).tap do |str|
          # `nil` is returned when a dynamic value is encountered in strict mode. Propagate:
          return nil if str.nil?
        end
      elsif !config[:strict] && %i[dsym dstr].include?(node.type)
        node.children.map do |child|
          if %i[sym str].include?(child.type)
            child.children[0].to_s
          else
            child.loc.expression.source
          end
        end.join
      end
    end
def extract_string(node, array_join_with: nil, array_flatten: false, array_reject_blank: false)
      if %i[sym str int].include?(node.type)
        node.children[0].to_s
      elsif %i[true false].include?(node.type) # rubocop:disable Lint/BooleanSymbol
        node.type.to_s
      elsif node.type == :nil
        ''
      elsif node.type == :array && array_join_with
        extract_array_as_string(
          node,
          array_join_with:    array_join_with,
          array_flatten:      array_flatten,
          array_reject_blank: array_reject_blank
        ).tap do |str|
          # `nil` is returned when a dynamic value is encountered in strict mode. Propagate:
          return nil if str.nil?
        end
      elsif !config[:strict] && %i[dsym dstr].include?(node.type)
        node.children.map do |child|
          if %i[sym str].include?(child.type)
            child.children[0].to_s
          else
            child.loc.expression.source
          end
        end.join
      end
    end
If the node type is of `%i(sym str int false true)`, return the value as a string.
 Otherwise, if `config[:strict]` is `false` and the type is of `%i(dstr dsym)`,
 return the source as if it were a string.

 @param node [Parser::AST::Node]
 @param array_join_with [String, nil] if set to a string, arrays will be processed and their elements joined.
 @param array_flatten [Boolean] if true, nested arrays are flattened,
     otherwise their source is copied and surrounded by #{}. No effect unless `array_join_with` is set.
 @param array_reject_blank [Boolean] if true, empty strings and `nil`s are skipped.
      No effect unless `array_join_with` is set.
 @return [String, nil] `nil` is returned only when a dynamic value is encountered in strict mode
     or the node type is not supported.