Class: Dap::Filter::FilterMatchSelectValue

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



115
116
117
118
119
120
121
122
123
124
125
# File 'lib/dap/filter/simple.rb', line 115

def process(doc)
  ndoc = {}
  self.opts.each_pair do |re,|
    doc.each_key do |k|
      if doc[k].match(re)
        ndoc[k] = doc[k]
      end
    end
  end
 (ndoc.keys.length == 0) ? [] : [ ndoc ]
end