Class: Dap::Filter::FilterSplitTab
- Inherits:
-
Object
- Object
- Dap::Filter::FilterSplitTab
- Includes:
- Base
- Defined in:
- lib/dap/filter/simple.rb
Instance Attribute Summary
Attributes included from Base
Instance Method Summary collapse
Methods included from Base
Instance Method Details
#process(doc) ⇒ Object
339 340 341 342 343 344 345 346 347 348 349 |
# File 'lib/dap/filter/simple.rb', line 339 def process(doc) lines = [ ] self.opts.each_pair do |k,v| if doc.has_key?(k) doc[k].to_s.split(/\t/).each do |line| lines << doc.merge({ "#{k}.tab" => line }) end end end lines.length == 0 ? [ doc ] : [ lines ] end |