method

quote

ruby latest stable - Class: CSV::Writer

Method not available on this version

This method is only available on newer versions. The first available version (v2_6_3) is shown here.

quote(field)
private

No documentation available.

# File lib/csv/writer.rb, line 138
    def quote(field)
      if @force_quotes
        quote_field(field)
      else
        if field.nil?  # represent +nil+ fields as empty unquoted fields
          ""
        else
          field = String(field)  # Stringify fields
          # represent empty fields as empty quoted fields
          if (@quote_empty and field.empty?) or @quotable_pattern.match?(field)
            quote_field(field)
          else
            field  # unquoted field
          end
        end
      end
    end