Class: Dap::Filter::FilterFlatten

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



328
329
330
331
332
333
334
335
336
337
# File 'lib/dap/filter/simple.rb', line 328

def process(doc)
  self.opts.each_pair do |k,|
    if doc.has_key?(k) and doc[k].is_a?(Hash)
      doc[k].each_pair do |fk,fv|
        doc["#{k}.#{fk}"] = fv
      end
    end
  end
 [ doc ]
end