'$。'是什么? (美元点)意味着在Ruby?
问题描述:
我做了$..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