Class: Nppes::UpdatePack::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/nppes/update_pack/base.rb

Direct Known Subclasses

Data, Header

Instance Method Summary collapse

Instance Method Details

#parse(file) ⇒ Object

Raises:

  • (Exception)


8
9
10
11
# File 'lib/nppes/update_pack/base.rb', line 8

def parse(file)
  raise Exception.new('Block required') unless block_given?
  file.each_with_index { |row, i| yield row unless i == 0 }
end

#split_row(row) ⇒ Object



13
14
15
# File 'lib/nppes/update_pack/base.rb', line 13

def split_row(row)
  row.gsub(/\A"|"\n?\z/, '').split(/\",\"/)
end