Class: ActionAudit::Factory
- Inherits:
-
Object
- Object
- ActionAudit::Factory
- Defined in:
- lib/action_audit/factory.rb
Class Method Summary collapse
- .add_change(*args) ⇒ Object
- .add_params(*args) ⇒ Object
- .current ⇒ Object
- .flush ⇒ Object
- .start ⇒ Object
- .with_auditor(params = {}) ⇒ Object
Class Method Details
.add_change(*args) ⇒ Object
27 28 29 |
# File 'lib/action_audit/factory.rb', line 27 def add_change(*args) current.add_change(*args) if current end |
.add_params(*args) ⇒ Object
23 24 25 |
# File 'lib/action_audit/factory.rb', line 23 def add_params(*args) current.add_params(*args) if current end |
.current ⇒ Object
3 4 5 |
# File 'lib/action_audit/factory.rb', line 3 def current Thread.current[:action_auditor] end |
.flush ⇒ Object
11 12 13 |
# File 'lib/action_audit/factory.rb', line 11 def flush Thread.current[:action_auditor] = nil end |
.start ⇒ Object
7 8 9 |
# File 'lib/action_audit/factory.rb', line 7 def start Thread.current[:action_auditor] = ActionAudit::EventProcessor.new(ActionAudit.store) end |
.with_auditor(params = {}) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/action_audit/factory.rb', line 15 def with_auditor(params = {}) start add_params(params) yield ensure flush end |