Class: AuditLoggable::AuditRecordSet
- Inherits:
-
Object
- Object
- AuditLoggable::AuditRecordSet
- Includes:
- Enumerable
- Defined in:
- lib/audit_loggable/audit_record_set.rb
Instance Method Summary collapse
- #<<(audit_record) ⇒ Object
- #clear ⇒ Object
- #each(&block) ⇒ Object
- #flush ⇒ Object
-
#initialize ⇒ AuditRecordSet
constructor
A new instance of AuditRecordSet.
Constructor Details
#initialize ⇒ AuditRecordSet
Returns a new instance of AuditRecordSet.
9 10 11 |
# File 'lib/audit_loggable/audit_record_set.rb', line 9 def initialize clear end |
Instance Method Details
#<<(audit_record) ⇒ Object
13 14 15 16 |
# File 'lib/audit_loggable/audit_record_set.rb', line 13 def <<(audit_record) set << audit_record self end |
#clear ⇒ Object
18 19 20 21 |
# File 'lib/audit_loggable/audit_record_set.rb', line 18 def clear @set = [] self end |
#each(&block) ⇒ Object
23 24 25 26 27 28 |
# File 'lib/audit_loggable/audit_record_set.rb', line 23 def each(&block) return to_enum unless block set.each(&block) self end |
#flush ⇒ Object
30 31 32 33 |
# File 'lib/audit_loggable/audit_record_set.rb', line 30 def flush ::AuditLoggable.logger.log(set) clear end |