Class: Fluent::TextParser::CSVParser
- Inherits:
-
ValuesParser
- Object
- Parser
- ValuesParser
- Fluent::TextParser::CSVParser
- Defined in:
- lib/fluent/parser.rb
Constant Summary
Constants included from TypeConverter
Constants included from Configurable
Configurable::CONFIG_TYPE_REGISTRY
Instance Attribute Summary
Attributes inherited from Parser
Instance Method Summary collapse
-
#initialize ⇒ CSVParser
constructor
A new instance of CSVParser.
- #parse(text) ⇒ Object
Methods inherited from ValuesParser
Methods included from TypeConverter
Methods inherited from Parser
Methods included from Configurable
#config, #configure, included, lookup_type, register_type
Constructor Details
#initialize ⇒ CSVParser
Returns a new instance of CSVParser.
435 436 437 438 |
# File 'lib/fluent/parser.rb', line 435 def initialize super require 'csv' end |
Instance Method Details
#parse(text) ⇒ Object
440 441 442 443 444 445 446 |
# File 'lib/fluent/parser.rb', line 440 def parse(text) if block_given? yield values_map(CSV.parse_line(text)) else return values_map(CSV.parse_line(text)) end end |