Project

General

Profile

Bug #7319 ยป ruby-doc-csv_skip_comments.patch

vbatts (Vincent Batts), 11/10/2012 02:59 AM

View differences:

lib/csv.rb
2206 2206
    init_converters(options, :header_converters)
2207 2207
  end
2208 2208

  
2209
  #
2210
  # Stores the pattern of comments to skip, from the options provided, (:skip_lines)
2211
  #
2212
  # The pattern must respond to .match, else ArgumentError is raised.
2213
  #
2214
  # See also CSV.new
2215
  #
2209 2216
  def init_comments(options)
2210 2217
    @skip_lines = options.delete(:skip_lines)
2211 2218
    if @skip_lines and not @skip_lines.respond_to?(:match)
2212 2219
      raise ArgumentError, ":skip_lines has to respond to matches"
2213 2220
    end
2214 2221
  end
2222

  
2215 2223
  #
2216 2224
  # The actual work method for adding converters, used by both CSV.convert() and
2217 2225
  # CSV.header_convert().