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
394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 |
# File 'lib/dap/filter/simple.rb', line 394 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 |