2017-08-03 29 views
0

我做了$..class,它显示它是一个Fixnum,但我不确定该值是如何派生的。这里是部分片段

csv_files.each do |csv_file| 
    method, year, currency_col = nil, nil, nil 

    CSV.foreach(csv_file, headers: true) do |row| 

    if $. == 2 
     method_col, year_col, currency_col = "Method", "Year", "Correct Currency" 
     method_col2, year_col2    = "Quotation Method", "Fiscal Year" 
     validate_headers(csv_file, row, [method_col, year_col, currency_col], [method_col2, year_col2, currency_col]) 

     method = row[method_col] || row[method_col2] 
     year = row[year_col] || row[year_col2] 
    end 

回答