Class: ActionAudit::EventProcessor

Inherits:
Object
  • Object
show all
Defined in:
lib/action_audit/event_processor.rb

Instance Method Summary collapse

Constructor Details

#initialize(store) ⇒ EventProcessor

Returns a new instance of EventProcessor.



4
5
6
7
# File 'lib/action_audit/event_processor.rb', line 4

def initialize(store)
  @store = store
  @params = {}
end

Instance Method Details

#add_change(entity, was, become) ⇒ Object



9
10
11
12
13
# File 'lib/action_audit/event_processor.rb', line 9

def add_change(entity, was, become)
  info "adding changeset for entity #{entity}"
  changes_state.trigger(:entity_changed)
  @store.save_change(@action_id, entity, was, become)
end

#add_params(params) ⇒ Object



15
16
17
18
# File 'lib/action_audit/event_processor.rb', line 15

def add_params(params)
  @params.merge!(params)
  changes_state.trigger(:params_added)
end