3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
# File 'lib/remote_table/file/roo_spreadsheet.rb', line 3
def each_row(&block)
= {}
oo = roo_klass.new(path, nil, :ignore)
oo.default_sheet = sheet.is_a?(Numeric) ? oo.sheets[sheet] : sheet
for col in (1..oo.last_column)
[col] = oo.cell(, col)
[col] = oo.cell( - 1, col) if [col].blank? end
first_data_row.upto(oo.last_row) do |row|
values = {}
for col in (1..oo.last_column)
values[[col]] = oo.cell(row, col).to_s.gsub(/<[^>]+>/, '').strip
end
yield HashWithIndifferentAccess.new(values)
end
end
|