Class: Dap::Filter::FilterFieldSplit
- Inherits:
-
Object
- Object
- Dap::Filter::FilterFieldSplit
- Includes:
- Base
- Defined in:
- lib/dap/filter/simple.rb
Direct Known Subclasses
FilterFieldSplitComma, FilterFieldSplitLine, FilterFieldSplitPeriod, FilterFieldSplitTab, FilterFieldSplitWord
Instance Attribute Summary
Attributes included from Base
Instance Method Summary collapse
Methods included from Base
Instance Method Details
#process(doc) ⇒ Object
447 448 449 450 451 452 453 454 455 456 457 458 |
# File 'lib/dap/filter/simple.rb', line 447 def process(doc) self.opts.each_pair do |k,v| if doc.has_key?(k) count = 1 doc[k].to_s.split(Regexp.new(v)).each do |thing| doc.merge!({ "#{k}.f#{count}" => thing }) count += 1 end end end [ doc ] end |