Class: ActionAuditor::Auditor::Simple
- Defined in:
- lib/action_auditor/auditor/simple.rb
Overview
The simplest possible implementation of an auditor. Simply maintains a list of [message, hash] pairs, with no persistence. This is mainly of use for testing.
Defined Under Namespace
Classes: LoggedAction
Instance Method Summary collapse
- #clear! ⇒ Object
-
#initialize ⇒ Simple
constructor
A new instance of Simple.
- #last ⇒ Object
- #log(message, parameters = {}) ⇒ Object
- #size ⇒ Object
Constructor Details
#initialize ⇒ Simple
Returns a new instance of Simple.
12 13 14 |
# File 'lib/action_auditor/auditor/simple.rb', line 12 def initialize = [] end |
Instance Method Details
#clear! ⇒ Object
16 17 18 |
# File 'lib/action_auditor/auditor/simple.rb', line 16 def clear! = [] end |
#last ⇒ Object
28 29 30 |
# File 'lib/action_auditor/auditor/simple.rb', line 28 def last .last end |
#log(message, parameters = {}) ⇒ Object
20 21 22 |
# File 'lib/action_auditor/auditor/simple.rb', line 20 def log(, parameters = {}) << LoggedAction.new(, parameters) end |
#size ⇒ Object
24 25 26 |
# File 'lib/action_auditor/auditor/simple.rb', line 24 def size .size end |