Class: CheekyDreams::SuppressDuplicatesAuditor
- Inherits:
-
Object
- Object
- CheekyDreams::SuppressDuplicatesAuditor
- Defined in:
- lib/cheeky-dreams.rb
Instance Method Summary collapse
- #audit(type, message) ⇒ Object
-
#initialize(auditor) ⇒ SuppressDuplicatesAuditor
constructor
A new instance of SuppressDuplicatesAuditor.
Constructor Details
#initialize(auditor) ⇒ SuppressDuplicatesAuditor
Returns a new instance of SuppressDuplicatesAuditor.
79 80 81 |
# File 'lib/cheeky-dreams.rb', line 79 def initialize auditor @auditor, @audits = auditor, Set.new end |
Instance Method Details
#audit(type, message) ⇒ Object
83 84 85 86 87 88 89 |
# File 'lib/cheeky-dreams.rb', line 83 def audit type, event = AuditEvent.new type, unless @audits.include?(event) @auditor.audit(type, ) @audits << event end end |