Class: Koine::Csv::CsvParser
- Inherits:
-
Object
- Object
- Koine::Csv::CsvParser
- Defined in:
- lib/koine/csv/csv_parser.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ CsvParser
constructor
A new instance of CsvParser.
- #parse(contents, &block) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ CsvParser
Returns a new instance of CsvParser.
6 7 8 9 10 |
# File 'lib/koine/csv/csv_parser.rb', line 6 def initialize( = {}) defaults = { column_separator: ";" } = defaults.merge() @parser_options = { col_sep: [:column_separator] } end |
Instance Method Details
#parse(contents, &block) ⇒ Object
12 13 14 |
# File 'lib/koine/csv/csv_parser.rb', line 12 def parse(contents, &block) CSV.parse(contents, , &block) end |