Class: Dap::Filter::FilterSelect

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



165
166
167
168
169
170
171
172
173
# File 'lib/dap/filter/simple.rb', line 165

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