Class: IuguLogger::Pii::Result
- Inherits:
-
Object
- Object
- IuguLogger::Pii::Result
- Defined in:
- lib/iugu_logger/pii.rb
Overview
Frozen result of a Pii scan. Logger uses this to populate the canonical pii.* block of the emitted payload.
Instance Attribute Summary collapse
-
#detected ⇒ Object
readonly
Returns the value of attribute detected.
-
#payload ⇒ Object
readonly
Returns the value of attribute payload.
-
#redacted_count ⇒ Object
readonly
Returns the value of attribute redacted_count.
Instance Method Summary collapse
-
#initialize(payload:, detected:, redacted_count:) ⇒ Result
constructor
A new instance of Result.
- #to_pii_block ⇒ Object
Constructor Details
#initialize(payload:, detected:, redacted_count:) ⇒ Result
Returns a new instance of Result.
137 138 139 140 141 142 |
# File 'lib/iugu_logger/pii.rb', line 137 def initialize(payload:, detected:, redacted_count:) @payload = payload @detected = detected.uniq.sort @redacted_count = redacted_count freeze end |
Instance Attribute Details
#detected ⇒ Object (readonly)
Returns the value of attribute detected.
135 136 137 |
# File 'lib/iugu_logger/pii.rb', line 135 def detected @detected end |
#payload ⇒ Object (readonly)
Returns the value of attribute payload.
135 136 137 |
# File 'lib/iugu_logger/pii.rb', line 135 def payload @payload end |
#redacted_count ⇒ Object (readonly)
Returns the value of attribute redacted_count.
135 136 137 |
# File 'lib/iugu_logger/pii.rb', line 135 def redacted_count @redacted_count end |
Instance Method Details
#to_pii_block ⇒ Object
144 145 146 147 148 149 150 |
# File 'lib/iugu_logger/pii.rb', line 144 def to_pii_block { 'scanned' => true, 'detected' => @detected.map(&:to_s), 'redacted' => @redacted_count } end |