lib/csv2hash/parser/collection.rb in csv2hash-0.0.2 vs lib/csv2hash/parser/collection.rb in csv2hash-0.1
- old
+ new
@@ -1,12 +1,14 @@
-module Parser::Collection extend Parser
+module Csv2hash::Parser::Collection
+ include Csv2hash::Parser
def fill!
- @data = {}.tap do |data_computed|
+ self.data = {}.tap do |data_computed|
data_computed[:data] ||= []
- @data_source.each_with_index do |line, y|
+ self.data_source.each_with_index do |line, y|
next if y < definition.header_size
+ next if self.ignore_blank_line and line.compact.empty?
data_computed[:data] << {}.tap do |data_parsed|
fill_it data_parsed, line
end
end
end
@@ -24,6 +26,6 @@
end
end
end
end
-end
\ No newline at end of file
+end