Class: SensitiveDataFilter::Middleware::Detect
- Inherits:
-
Object
- Object
- SensitiveDataFilter::Middleware::Detect
- Defined in:
- lib/sensitive_data_filter/middleware/detect.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(filter) ⇒ Detect
constructor
A new instance of Detect.
Constructor Details
#initialize(filter) ⇒ Detect
Returns a new instance of Detect.
4 5 6 |
# File 'lib/sensitive_data_filter/middleware/detect.rb', line 4 def initialize(filter) @filter = filter end |
Instance Method Details
#call ⇒ Object
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/sensitive_data_filter/middleware/detect.rb', line 8 def call changeset = nil scan = run_scan if scan.matches? changeset = OpenStruct.new(SensitiveDataFilter::Middleware::FILTERABLE.each_with_object({}) { |filterable, hash| hash[filterable.to_s] = SensitiveDataFilter::Mask.mask(@filter.send(filterable)) }) end [changeset, scan] end |