Class: Dap::Filter::FilterFieldSplitLine

Inherits:
Object
  • Object
show all
Includes:
Base
Defined in:
lib/dap/filter/simple.rb

Instance Attribute Summary

Attributes included from Base

#name, #opts

Instance Method Summary collapse

Methods included from Base

#initialize

Instance Method Details

#process(doc) ⇒ Object



374
375
376
377
378
379
380
381
382
383
384
385
# File 'lib/dap/filter/simple.rb', line 374

def process(doc)
  self.opts.each_pair do |k,v|
    if doc.has_key?(k)
      lcount = 1
      doc[k].to_s.split(/\n/).each do |line|
        doc.merge!({ "#{k}.f#{lcount}" => line })
        lcount += 1
      end
    end
  end
 [ doc ]
end