Class: Dap::Filter::FilterDigest
- Inherits:
-
Object
- Object
- Dap::Filter::FilterDigest
- Includes:
- Base
- Defined in:
- lib/dap/filter/simple.rb
Instance Attribute Summary
Attributes included from Base
Instance Method Summary collapse
Methods included from Base
Instance Method Details
#process(doc) ⇒ Object
368 369 370 371 372 373 374 375 376 377 378 379 380 |
# File 'lib/dap/filter/simple.rb', line 368 def process(doc) self.opts.each_pair do |k,v| if doc.has_key?(k) case v when 'sha1' doc["#{k}.sha1"] = Digest::SHA1.hexdigest(doc[k].to_s) when 'md5' doc["#{k}.md5"] = Digest::MD5.hexdigest(doc[k].to_s) end end end [ doc ] end |