Class: Dap::Filter::FilterMatchSelect

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

Direct Known Subclasses

FilterMatchSelectKey

Instance Attribute Summary

Attributes included from Base

#name, #opts

Instance Method Summary collapse

Methods included from Base

#initialize

Instance Method Details

#process(doc) ⇒ Object



132
133
134
135
136
137
138
139
140
141
142
# File 'lib/dap/filter/simple.rb', line 132

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