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
471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 |
# File 'lib/dap/filter/simple.rb', line 471 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) when 'sha256' doc["#{k}.sha256"] = Digest::SHA256.hexdigest(doc[k].to_s) end end end [ doc ] end |