Class: Fluent::TextParser::TSVParser

Inherits:
ValuesParser show all
Defined in:
lib/fluent/parser.rb

Constant Summary

Constants included from TypeConverter

Fluent::TextParser::TypeConverter::Converters

Constants included from Configurable

Configurable::CONFIG_TYPE_REGISTRY

Instance Attribute Summary

Attributes inherited from Parser

#estimate_current_event

Instance Method Summary collapse

Methods inherited from ValuesParser

#values_map

Methods included from TypeConverter

included

Methods inherited from Parser

#call, #initialize

Methods included from Configurable

#config, included, #initialize, lookup_type, register_type

Constructor Details

This class inherits a constructor from Fluent::Parser

Instance Method Details

#configure(conf) ⇒ Object



392
393
394
395
# File 'lib/fluent/parser.rb', line 392

def configure(conf)
  super
  @key_num = @keys.length
end

#parse(text) ⇒ Object



397
398
399
400
401
402
403
# File 'lib/fluent/parser.rb', line 397

def parse(text)
  if block_given?
    yield values_map(text.split(@delimiter, @key_num))
  else
    return values_map(text.split(@delimiter, @key_num))
  end
end