Class: CardPrinter::Parser::CsvParser

Inherits:
Base
  • Object
show all
Defined in:
lib/card_printer/parser/csv.rb

Instance Attribute Summary

Attributes inherited from Base

#iostream

Instance Method Summary collapse

Methods inherited from Base

#initialize, #parse

Constructor Details

This class inherits a constructor from CardPrinter::Parser::Base

Instance Method Details

#parse_line(line) ⇒ Object



5
6
7
8
9
10
11
12
13
# File 'lib/card_printer/parser/csv.rb', line 5

def parse_line(line)
  parsed = CSV.parse_line(line)
  if @headers
    Hash[@headers.zip(parsed)]
  else
    @headers = parsed
    nil
  end
end